Add unchecked
This commit is contained in:
parent
35992d140b
commit
8a2196f6ee
1 changed files with 12 additions and 0 deletions
|
@ -115,6 +115,18 @@ impl World {
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn entity_resources_unchecked<'a>(
|
||||||
|
&mut self,
|
||||||
|
entity: Entity,
|
||||||
|
) -> Result<(&'a mut EntityObject, &'a mut Resources)> {
|
||||||
|
Ok((
|
||||||
|
// actually safe:
|
||||||
|
// entity_mut only accesses entity map
|
||||||
|
unsafe { remove_life_time_mut(self.entity_mut(entity)?) },
|
||||||
|
unsafe { remove_life_time_mut(&mut self.resources) },
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
pub fn entity(
|
pub fn entity(
|
||||||
&self,
|
&self,
|
||||||
entity: Entity,
|
entity: Entity,
|
||||||
|
|
Loading…
Reference in a new issue