summaryrefslogtreecommitdiff
path: root/ecs/src/query.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2024-08-21 20:18:37 +0200
committerHampusM <hampus@hampusmat.com>2024-08-21 20:18:37 +0200
commit58f29444ac234c285ce0e3a729ade2b52a303f58 (patch)
tree03bb210d62bf98acc1ee30ce9df1344d8239f7c6 /ecs/src/query.rs
parentc3c96f2d7b63d1d7e55f5a9a85da85444089c2a2 (diff)
refactor(ecs): fix clippy lints
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