pub fn replace(self, component: T) -> Option<T> {
        match self {
            StorageEntry::Occupied(mut occupied) => Some(occupied.insert(component)),
            StorageEntry::Vacant(vacant) => {
                vacant.insert(component);
                None
            }
        }
    }
/// Inserts a component and returns the old value in case this entry was
/// already occupied.
Inserts a component and returns the old value in case this entry was
already occupied.
Inserts a component and returns the old value in case this entry was already occupied .
pub fn replace(self, component: T) -> Option<T> {
        match self {
            StorageEntry::Occupied(mut occupied) => Some(occupied.insert(component)),
            StorageEntry::Vacant(vacant) => {
                vacant.insert(component);
                None
            }
        }
    }
pub fn replace ( self , component : T ) -> Option < T > { match self { StorageEntry :: Occupied ( mut occupied ) => Some ( occupied . insert ( component ) ) , StorageEntry :: Vacant ( vacant ) => { vacant . insert ( component ) ; None } } }
Inserts a component and returns the old value in case this entry was
already occupied.
Inserts a component and returns the old value in case this entry was already occupied .
self
component
T