fn cut(&mut self, child: Handle) {
        debug_assert!(self.node(child).pos.is_child());

        match self.node(child).pos {
            Position::Root(_) => unsafe { ::unreachable::unreachable() },
            Position::Child(parent, idx) => {
                self.node_mut(parent).children.swap_remove(idx);
                self.node_mut(child).pos = Position::root(self.len());
                self.insert_root(child);
            }
        }
    }
/// Cuts the given `child` from its parent and inserts it as a root into the `PairingHeap`.
/// Will panic if the given `child` is not a child and thus a root node already.
Cuts the given `child` from its parent and inserts it as a root into the `PairingHeap`.
Will panic if the given `child` is not a child and thus a root node already.
Cuts the given ` child ` from its parent and inserts it as a root into the ` PairingHeap ` . Will panic if the given ` child ` is not a child and thus a root node already .
fn cut(&mut self, child: Handle) {
        debug_assert!(self.node(child).pos.is_child());
        match self.node(child).pos {
            Position::Root(_) => unsafe { ::unreachable::unreachable() },
            Position::Child(parent, idx) => {
                self.node_mut(parent).children.swap_remove(idx);
                self.node_mut(child).pos = Position::root(self.len());
                self.insert_root(child);
            }
        }
    }
fn cut ( & mut self , child : Handle ) { debug_assert ! ( self node ( child ) pos is_child ( ) ) ; match self . node ( child ) . pos { Position :: Root ( _ ) => unsafe { :: unreachable :: unreachable ( ) } , Position :: Child ( parent , idx ) => { self . node_mut ( parent ) . children . swap_remove ( idx ) ; self . node_mut ( child ) . pos = Position :: root ( self . len ( ) ) ; self . insert_root ( child ) ; } } }
Cuts the given `child` from its parent and inserts it as a root into the `PairingHeap`.
Cuts the given ` child ` from its parent and inserts it as a root into the ` PairingHeap ` .
&mut self
child
Handle
&mut self
child
Handle