From 8a2196f6ee77833510b4cd7a2d681ec5ded36548 Mon Sep 17 00:00:00 2001 From: hodasemi Date: Thu, 6 Mar 2025 09:50:12 +0100 Subject: [PATCH] Add unchecked --- ecs/src/world.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ecs/src/world.rs b/ecs/src/world.rs index de53e2e..3270813 100644 --- a/ecs/src/world.rs +++ b/ecs/src/world.rs @@ -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( &self, entity: Entity,