From aeed1b1ff3e34fe719a2f7e6097584b99a673ded Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 7 Jun 2025 20:23:34 +0200 Subject: refactor(ecs): make entity::Handle not hold world reference --- ecs/src/entity.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'ecs/src/entity.rs') diff --git a/ecs/src/entity.rs b/ecs/src/entity.rs index 196bd01..4496a2b 100644 --- a/ecs/src/entity.rs +++ b/ecs/src/entity.rs @@ -19,7 +19,6 @@ use crate::{EntityComponentRef, World}; #[derive(Debug)] pub struct Handle<'a> { - _world: &'a World, archetype: &'a Archetype, entity: &'a ArchetypeEntity, } @@ -97,13 +96,9 @@ impl<'a> Handle<'a> } } - pub(crate) fn new( - world: &'a World, - archetype: &'a Archetype, - entity: &'a ArchetypeEntity, - ) -> Self + pub(crate) fn new(archetype: &'a Archetype, entity: &'a ArchetypeEntity) -> Self { - Self { _world: world, archetype, entity } + Self { archetype, entity } } } -- cgit v1.2.3-18-g5258