pub fn decrease_key(&mut self, handle: Handle, new_key: K) -> Result<()> {
        if new_key >= self.node(handle).entry.key {
            return Err(Error::DecreaseKeyOutOfOrder);
        }

        self.node_mut(handle).entry.key = new_key;
        match self.node(handle).pos {
            Position::Root(_) => {
                self.update_min(handle);
            }
            Position::Child(..) => self.cut(handle),
        }
        Ok(())
    }
/// Decreases the key of the element with the associated given `handle`.
/// Will panic if the given new key is not lower than the previous key.
Decreases the key of the element with the associated given `handle`.
Will panic if the given new key is not lower than the previous key.
Decreases the key of the element with the associated given ` handle ` . Will panic if the given new key is not lower than the previous key .
pub fn decrease_key(&mut self, handle: Handle, new_key: K) -> Result<()> {
        if new_key >= self.node(handle).entry.key {
            return Err(Error::DecreaseKeyOutOfOrder);
        }
        self.node_mut(handle).entry.key = new_key;
        match self.node(handle).pos {
            Position::Root(_) => {
                self.update_min(handle);
            }
            Position::Child(..) => self.cut(handle),
        }
        Ok(())
    }
pub fn decrease_key ( & mut self , handle : Handle , new_key : K ) -> Result < ( ) > { if new_key >= self . node ( handle ) . entry . key { return Err ( Error :: DecreaseKeyOutOfOrder ) ; } self . node_mut ( handle ) . entry . key = new_key ; match self . node ( handle ) . pos { Position :: Root ( _ ) => { self . update_min ( handle ) ; } Position :: Child ( .. ) => self . cut ( handle ) , } Ok ( ( ) ) }
Decreases the key of the element with the associated given `handle`.
Decreases the key of the element with the associated given ` handle ` .
&mut self
handle
Handle
new_key
K
&mut self
handle
Handle
new_key
K