From 58f29444ac234c285ce0e3a729ade2b52a303f58 Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 21 Aug 2024 20:18:37 +0200 Subject: refactor(ecs): fix clippy lints --- ecs/src/query.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ecs/src/query.rs') 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 { 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>() -> bool -- cgit v1.2.3-18-g5258