pub fn remove(self) -> V {
        let slot = unsafe { self.map.slots.get_unchecked_mut(self.kd.idx as usize) };
        self.map.num_elems -= 1;
        match replace(slot, Slot::new_vacant()) {
            Occupied { value, .. } => value,
            Vacant => unsafe { unreachable_unchecked() },
        }
    }
/// Takes the value out of the entry, and returns it.
///
/// # Examples
///
/// ```
/// # use slotmap::*;
/// # use slotmap::secondary::Entry;
///
/// let mut sm = SlotMap::new();
/// let mut sec = SecondaryMap::new();
///
/// let k = sm.insert(1);
/// sec.insert(k, 10);
///
/// if let Entry::Occupied(mut o) = sec.entry(k).unwrap() {
///     assert_eq!(o.remove(), 10);
///     assert_eq!(sec.contains_key(k), false);
/// }
/// ```
Takes the value out of the entry, and returns it.
Takes the value out of the entry and returns it .
pub fn remove(self) -> V {
        let slot = unsafe { self.map.slots.get_unchecked_mut(self.kd.idx as usize) };
        self.map.num_elems -= 1;
        match replace(slot, Slot::new_vacant()) {
            Occupied { value, .. } => value,
            Vacant => unsafe { unreachable_unchecked() },
        }
    }
pub fn remove ( self ) -> V { let slot = unsafe { self . map . slots . get_unchecked_mut ( self . kd . idx as usize ) } ; self . map . num_elems -= 1 ; match replace ( slot , Slot :: new_vacant ( ) ) { Occupied { value , .. } => value , Vacant => unsafe { unreachable_unchecked ( ) } , } }
Takes the value out of the entry, and returns it.
Takes the value out of the entry and returns it .
self
examples
None
use slotmap::*;
None
use slotmap::secondary::entry;
let mut sm = SlotMap::new();
let mut sec = SecondaryMap::new().



if let Entry::Occupied(mut o) = sec.entry(k).unwrap() {
assert_eq!(o.remove(), 10);
assert_eq!(sec.contains_key(k), false);
}
```
let mut sm = SlotMap :: new () ; let mut sec = SecondaryMap :: new () . if let Entry :: Occupied ( mut o ) = sec . entry ( k ) . unwrap () { assert_eq! ( o . remove () 10 ) ; assert_eq! ( sec . contains_key ( k ) false ) ; } ` ` `