pub unsafe fn pop_unchecked(&mut self) -> T {
        let min = self.min;
        match self.node(min).pos {
            Position::Child(..) => ::unreachable::unreachable(),
            Position::Root(idx) => {
                self.roots.swap_remove(idx);
                self.min = Handle::undef();
                for child in
                    ::std::mem::replace(&mut self.node_mut(min).children, Vec::new()).into_iter()
                {
                    self.insert_root(child);
                }
                self.pairwise_union();
                self.data.take_unchecked(min).entry.elem
            }
        }
    }
/// Removes the element associated with the minimum key within this `PairingHeap` without
/// checking for emptiness and returns it.
///
/// So use this method carefully!
///
/// # Safety
///
/// This is unsafe because the heap is not checked to be non-empty.
Removes the element associated with the minimum key within this `PairingHeap` without
checking for emptiness and returns it.

So use this method carefully!
Removes the element associated with the minimum key within this ` PairingHeap ` without checking for emptiness and returns it . So use this method carefully!
pub unsafe fn pop_unchecked(&mut self) -> T {
        let min = self.min;
        match self.node(min).pos {
            Position::Child(..) => ::unreachable::unreachable(),
            Position::Root(idx) => {
                self.roots.swap_remove(idx);
                self.min = Handle::undef();
                for child in
                    ::std::mem::replace(&mut self.node_mut(min).children, Vec::new()).into_iter()
                {
                    self.insert_root(child);
                }
                self.pairwise_union();
                self.data.take_unchecked(min).entry.elem
            }
        }
    }
pub unsafe fn pop_unchecked ( & mut self ) -> T { let min = self . min ; match self . node ( min ) . pos { Position :: Child ( .. ) => :: unreachable :: unreachable ( ) , Position :: Root ( idx ) => { self . roots . swap_remove ( idx ) ; self . min = Handle :: undef ( ) ; for child in :: std :: mem :: replace ( & mut self . node_mut ( min ) . children , Vec :: new ( ) ) . into_iter ( ) { self . insert_root ( child ) ; } self . pairwise_union ( ) ; self . data . take_unchecked ( min ) . entry . elem } } }
Removes the element associated with the minimum key within this `PairingHeap` without
checking for emptiness and returns it.
Removes the element associated with the minimum key within this ` PairingHeap ` without checking for emptiness and returns it .
&mut self
&mut self
safety
This is unsafe because the heap is not checked to be non-empty.
This is unsafe because the heap is not checked to be non - empty .