pub fn insert(self, value: V) -> &'a mut V {
        let slot = unsafe { self.map.slots.get_unchecked_mut(self.kd.idx as usize) };
        // Despite the slot being considered Vacant for this entry, it might be occupied
        // with an outdated element.
        match replace(slot, Slot::new_occupied(self.kd.version.get(), value)) {
            Occupied { .. } => {},
            Vacant => self.map.num_elems += 1,
        }
        unsafe { slot.get_unchecked_mut() }
    }
/// Sets the value of the entry with the [`VacantEntry`]'s key, and returns
/// a mutable reference to it.
///
/// # Examples
///
/// ```
/// # use slotmap::*;
/// # use slotmap::secondary::Entry;
///
/// let mut sm = SlotMap::new();
/// let mut sec = SecondaryMap::new();
///
/// let k = sm.insert(1);
///
/// if let Entry::Vacant(v) = sec.entry(k).unwrap() {
///     let new_val = v.insert(3);
///     assert_eq!(new_val, &mut 3);
/// }
/// ```
Sets the value of the entry with the [`VacantEntry`]'s key, and returns
a mutable reference to it.
Sets the value of the entry with the [ ` VacantEntry ` ] ' s key and returns a mutable reference to it .
pub fn insert(self, value: V) -> &'a mut V {
        let slot = unsafe { self.map.slots.get_unchecked_mut(self.kd.idx as usize) };
        // Despite the slot being considered Vacant for this entry, it might be occupied
        // with an outdated element.
        match replace(slot, Slot::new_occupied(self.kd.version.get(), value)) {
            Occupied { .. } => {},
            Vacant => self.map.num_elems += 1,
        }
        unsafe { slot.get_unchecked_mut() }
    }
pub fn insert ( self , value : V ) -> & ' a mut V { let slot = unsafe { self . map . slots . get_unchecked_mut ( self . kd . idx as usize ) } ; // Despite the slot being considered Vacant for this entry, it might be occupied // with an outdated element. match replace ( slot , Slot :: new_occupied ( self . kd . version . get ( ) , value ) ) { Occupied { .. } => { } , Vacant => self . map . num_elems += 1 , } unsafe { slot . get_unchecked_mut ( ) } }
Sets the value of the entry with the [`VacantEntry`]'s key, and returns
a mutable reference to it.
Sets the value of the entry with the [ ` VacantEntry ` ] ' s key and returns a mutable reference to it .
self
value
V
examples
None
use slotmap::*;
None
use slotmap::secondary::entry;
let mut sm = SlotMap::new();
let mut sec = SecondaryMap::new().

let k = sm.insert(1).

if let Entry::Vacant(v) = sec.entry(k).unwrap() {
let new_val = v.insert(3);
assert_eq!(new_val, &mut 3);
}
```
let mut sm = SlotMap :: new () ; let mut sec = SecondaryMap :: new () . let k = sm . insert ( 1 ) . if let Entry :: Vacant ( v ) = sec . entry ( k ) . unwrap () { let new_val = v . insert ( 3 ) ; assert_eq! ( new_val &mut 3 ) ; } ` ` `