summaryrefslogtreecommitdiff
path: root/ecs/src/query.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ecs/src/query.rs')
-rw-r--r--ecs/src/query.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/ecs/src/query.rs b/ecs/src/query.rs
index dea3039..944deb1 100644
--- a/ecs/src/query.rs
+++ b/ecs/src/query.rs
@@ -53,7 +53,7 @@ where
entities: self
.component_storage
.find_entities(Comps::metadata())
- .map((|archetype| archetype.entities()) as ComponentIterMapFn)
+ .map(Archetype::entities as ComponentIterMapFn)
.flatten()
.filter(|entity| OptionsT::entity_filter(entity.components())),
comps_pd: PhantomData,
@@ -61,13 +61,13 @@ where
}
/// Returns the UID of the entity at the given query iteration index.
+ #[must_use]
pub fn entity_uid(&self, entity_index: usize) -> Option<EntityUid>
{
Some(
self.component_storage
.find_entities(Comps::metadata())
- .map(|archetype| archetype.entities())
- .flatten()
+ .flat_map(|archetype| archetype.entities())
.filter(|entity| OptionsT::entity_filter(entity.components()))
.nth(entity_index)?
.uid(),
@@ -123,7 +123,7 @@ where
world: &'world World,
) -> Self
{
- Self::new(&world)
+ Self::new(world)
}
fn is_compatible<Other: SystemParam<'world>>() -> bool