pub fn reserve(&mut self, additional: usize) {
        // One slot is reserved for the sentinel.
        let needed = (self.len() + additional).saturating_sub(self.slots.len() - 1);
        self.slots.reserve(needed);
    }
/// Reserves capacity for at least `additional` more elements to be inserted
/// in the [`SlotMap`]. The collection may reserve more space to avoid
/// frequent reallocations.
///
/// # Panics
///
/// Panics if the new allocation size overflows [`usize`].
///
/// # Examples
///
/// ```
/// # use slotmap::*;
/// let mut sm = SlotMap::new();
/// sm.insert("foo");
/// sm.reserve(32);
/// assert!(sm.capacity() >= 33);
/// ```
Reserves capacity for at least `additional` more elements to be inserted
in the [`SlotMap`]. The collection may reserve more space to avoid
frequent reallocations.
Reserves capacity for at least ` additional ` more elements to be inserted in the [ ` SlotMap ` ] . The collection may reserve more space to avoid frequent reallocations .
pub fn reserve(&mut self, additional: usize) {
        // One slot is reserved for the sentinel.
        let needed = (self.len() + additional).saturating_sub(self.slots.len() - 1);
        self.slots.reserve(needed);
    }
pub fn reserve ( & mut self , additional : usize ) { // One slot is reserved for the sentinel. let needed = ( self . len ( ) + additional ) . saturating_sub ( self . slots . len ( ) - 1 ) ; self . slots . reserve ( needed ) ; }
Reserves capacity for at least `additional` more elements to be inserted
in the [`SlotMap`].
Reserves capacity for at least ` additional ` more elements to be inserted in the [ ` SlotMap ` ] .
&mut self
additional
usize
panics
Panics if the new allocation size overflows [`usize`].
Panics if the new allocation size overflows [ ` usize ` ] .
examples
None
use slotmap::*;
None