diff options
author | HampusM <hampus@hampusmat.com> | 2025-06-07 20:16:40 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2025-06-07 20:16:40 +0200 |
commit | caf56d34449b471169b7c71eddabad230449dfe3 (patch) | |
tree | a1ce343c8a091ff7269037efab8c7a23dce84d89 /ecs/src/query/term.rs | |
parent | 15c6cde9b01d8d62a21d61ca620aff4ef61b12dd (diff) |
refactor(ecs): remove component::HandleFromEntityComponentRef
Diffstat (limited to 'ecs/src/query/term.rs')
-rw-r--r-- | ecs/src/query/term.rs | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/ecs/src/query/term.rs b/ecs/src/query/term.rs index 2e1ecca..9c772da 100644 --- a/ecs/src/query/term.rs +++ b/ecs/src/query/term.rs @@ -4,7 +4,6 @@ use std::marker::PhantomData; use crate::component::{ Component, Handle as ComponentHandle, - HandleFromEntityComponentRef, HandleMut as ComponentHandleMut, }; use crate::query::{ @@ -65,17 +64,14 @@ impl<ComponentT: Component> TermWithField for Option<&ComponentT> fn get_field<'world>( entity_handle: &crate::entity::Handle<'world>, - world: &'world crate::World, + _world: &'world crate::World, ) -> Self::Field<'world> { Some( ComponentHandle::<'world, ComponentT>::from_entity_component_ref( - Some( - entity_handle - .get_matching_components(ComponentT::id()) - .next()?, - ), - world, + entity_handle + .get_matching_components(ComponentT::id()) + .next()?, ) .unwrap_or_else(|err| { panic!( @@ -99,17 +95,14 @@ impl<ComponentT: Component> TermWithField for Option<&mut ComponentT> fn get_field<'world>( entity_handle: &crate::entity::Handle<'world>, - world: &'world crate::World, + _world: &'world crate::World, ) -> Self::Field<'world> { Some( ComponentHandleMut::<'world, ComponentT>::from_entity_component_ref( - Some( - entity_handle - .get_matching_components(ComponentT::id()) - .next()?, - ), - world, + entity_handle + .get_matching_components(ComponentT::id()) + .next()?, ) .unwrap_or_else(|err| { panic!( |