summaryrefslogtreecommitdiff
path: root/ecs/src/query/term.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ecs/src/query/term.rs')
-rw-r--r--ecs/src/query/term.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/ecs/src/query/term.rs b/ecs/src/query/term.rs
index 9c772da..0683918 100644
--- a/ecs/src/query/term.rs
+++ b/ecs/src/query/term.rs
@@ -69,7 +69,7 @@ impl<ComponentT: Component> TermWithField for Option<&ComponentT>
{
Some(
ComponentHandle::<'world, ComponentT>::from_entity_component_ref(
- entity_handle
+ &entity_handle
.get_matching_components(ComponentT::id())
.next()?,
)
@@ -95,14 +95,15 @@ 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(
- entity_handle
+ &entity_handle
.get_matching_components(ComponentT::id())
.next()?,
+ world,
)
.unwrap_or_else(|err| {
panic!(