pub fn pop(&mut self) -> Option<T> {
        self.bit.pop();
        self.data.pop().map(|mut item| {
            if !self.is_empty() {
                swap(&mut item, &mut self.data[0]);
                // SAFETY: !self.is_empty() means that self.len() > 0
                unsafe { self.sift_down(0) };
            }
            item
        })
    }
/// Removes the greatest item from the weak heap and returns it, or `None` if it
/// is empty.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// use weakheap::WeakHeap;
/// let mut heap = WeakHeap::from(vec![1, 3]);
///
/// assert_eq!(heap.pop(), Some(3));
/// assert_eq!(heap.pop(), Some(1));
/// assert_eq!(heap.pop(), None);
/// ```
///
/// # Time complexity
///
/// The worst case cost of `pop` on a heap containing *n* elements is *O*(log(*n*)).
///
/// Sifting down in a weak heap can be done in *log(2, n)* comparisons,
/// as opposed to *2log(2, n)* for binary heap.
Removes the greatest item from the weak heap and returns it, or `None` if it
is empty.
Removes the greatest item from the weak heap and returns it or ` None ` if it is empty .
pub fn pop(&mut self) -> Option<T> {
        self.bit.pop();
        self.data.pop().map(|mut item| {
            if !self.is_empty() {
                swap(&mut item, &mut self.data[0]);
                // SAFETY: !self.is_empty() means that self.len() > 0
                unsafe { self.sift_down(0) };
            }
            item
        })
    }
pub fn pop ( & mut self ) -> Option < T > { self . bit . pop ( ) ; self . data . pop ( ) . map ( | mut item | { if ! self . is_empty ( ) { swap ( & mut item , & mut self . data [ 0 ] ) ; // SAFETY: !self.is_empty() means that self.len() > 0 unsafe { self . sift_down ( 0 ) } ; } item } ) }
Removes the greatest item from the weak heap and returns it, or `None` if it
is empty.
Removes the greatest item from the weak heap and returns it or ` None ` if it is empty .
&mut self
examples
Basic usage.

```
use weakheap::WeakHeap;
let mut heap = WeakHeap::from(vec![1, 3]).


Basic usage . ` ` ` use weakheap :: WeakHeap ; let mut heap = WeakHeap :: from ( vec! [ 1 3 ] ) .
time complexity
The worst case cost of `pop` on a heap containing *n* elements is *O*(log(*n*)).

Sifting down in a weak heap can be done in *log(2, n)* comparisons,
as opposed to *2log(2, n)* for binary heap.
The worst case cost of ` pop ` on a heap containing * n * elements is * O * ( log ( * n * )) . Sifting down in a weak heap can be done in * log ( 2 n ) * comparisons as opposed to * 2log ( 2 n ) * for binary heap .