diff options
Diffstat (limited to 'ecs/src/relationship.rs')
-rw-r--r-- | ecs/src/relationship.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/ecs/src/relationship.rs b/ecs/src/relationship.rs index 89c64ed..235c21e 100644 --- a/ecs/src/relationship.rs +++ b/ecs/src/relationship.rs @@ -62,7 +62,7 @@ where Kind: 'static, ComponentT: Component, { - component_storage_lock: ReadGuard<'static, ComponentStorage>, + component_storage_lock: ReadGuard<'rel_comp, ComponentStorage>, relationship_comp: ComponentRefMut<'rel_comp, Relationship<Kind, ComponentT>>, } @@ -91,9 +91,7 @@ where Ok(Self { relationship_comp, - // SAFETY: The component lock is not used for longer than the original - // lifetime - component_storage_lock: unsafe { component_storage_lock.upgrade_lifetime() }, + component_storage_lock, }) } } @@ -286,7 +284,7 @@ where Kind: 'static, ComponentT: Component, { - component_storage_lock: ReadGuard<'static, ComponentStorage>, + component_storage_lock: ReadGuard<'rel_comp, ComponentStorage>, relationship_comp: ComponentRef<'rel_comp, Relationship<Kind, ComponentT>>, } @@ -315,9 +313,7 @@ where Ok(Self { relationship_comp, - // SAFETY: The component lock is not used for longer than the original - // lifetime - component_storage_lock: unsafe { component_storage_lock.upgrade_lifetime() }, + component_storage_lock, }) } } |