unsafe fn remove_assume_moved(&mut self, id: TypeId) -> bool {
        if let Some(idx) = self.types.iter().position(|t| t.id() == id) {
            let ty = self.types[idx];
            let data = &mut self.components[idx];
            match data {
                ComponentData::WorldOwned(..) => {
                    *data = ComponentData::Removed;
                    true
                }
                ComponentData::ScopeOwned(ptr) => {
                    alloc::alloc::dealloc(ptr.as_ptr(), ty.layout());
                    *data = ComponentData::Removed;
                    true
                }
                _ => false,
            }
        } else {
            false
        }
    }
/// Frees scope-owned memory without dropping the data,
/// effectively assuming it has been moved.
Frees scope-owned memory without dropping the data,
effectively assuming it has been moved.
Frees scope - owned memory without dropping the data effectively assuming it has been moved .
unsafe fn remove_assume_moved(&mut self, id: TypeId) -> bool {
        if let Some(idx) = self.types.iter().position(|t| t.id() == id) {
            let ty = self.types[idx];
            let data = &mut self.components[idx];
            match data {
                ComponentData::WorldOwned(..) => {
                    *data = ComponentData::Removed;
                    true
                }
                ComponentData::ScopeOwned(ptr) => {
                    alloc::alloc::dealloc(ptr.as_ptr(), ty.layout());
                    *data = ComponentData::Removed;
                    true
                }
                _ => false,
            }
        } else {
            false
        }
    }
unsafe fn remove_assume_moved ( & mut self , id : TypeId ) -> bool { if let Some ( idx ) = self . types . iter ( ) . position ( | t | t . id ( ) == id ) { let ty = self . types [ idx ] ; let data = & mut self . components [ idx ] ; match data { ComponentData :: WorldOwned ( .. ) => { * data = ComponentData :: Removed ; true } ComponentData :: ScopeOwned ( ptr ) => { alloc :: alloc :: dealloc ( ptr . as_ptr ( ) , ty . layout ( ) ) ; * data = ComponentData :: Removed ; true } _ => false , } } else { false } }
Frees scope-owned memory without dropping the data,
effectively assuming it has been moved.
Frees scope - owned memory without dropping the data effectively assuming it has been moved .
&mut self
id
TypeId
&mut self
id
TypeId