pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut V {
        match self {
            Entry::Occupied(x) => x.into_mut(),
            Entry::Vacant(x) => x.insert(default()),
        }
    }
/// Ensures a value is in the entry by inserting the result of the default
/// function if empty, and returns a mutable reference to the value in the
/// entry.
///
/// # Examples
///
/// ```
/// # use slotmap::*;
/// let mut sm = SlotMap::new();
/// let mut sec = SparseSecondaryMap::new();
///
/// let k = sm.insert(1);
/// let v = sec.entry(k).unwrap().or_insert_with(|| "foobar".to_string());
/// assert_eq!(v, &"foobar");
/// ```
Ensures a value is in the entry by inserting the result of the default
function if empty, and returns a mutable reference to the value in the
entry.
Ensures a value is in the entry by inserting the result of the default function if empty and returns a mutable reference to the value in the entry .
pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut V {
        match self {
            Entry::Occupied(x) => x.into_mut(),
            Entry::Vacant(x) => x.insert(default()),
        }
    }
pub fn or_insert_with < F : FnOnce ( ) -> V > ( self , default : F ) -> & ' a mut V { match self { Entry :: Occupied ( x ) => x . into_mut ( ) , Entry :: Vacant ( x ) => x . insert ( default ( ) ) , } }
Ensures a value is in the entry by inserting the result of the default
function if empty, and returns a mutable reference to the value in the
entry.
Ensures a value is in the entry by inserting the result of the default function if empty and returns a mutable reference to the value in the entry .
self
default
F
examples
None
use slotmap::*;
let mut sm = SlotMap::new();
let mut sec = SparseSecondaryMap::new().


let mut sm = SlotMap :: new () ; let mut sec = SparseSecondaryMap :: new () .