From 82123b59e0be2fa10db04a6b1d7798382cbc0686 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 8 Dec 2024 21:56:13 +0100 Subject: refactor(ecs): make query options entity_filter fn take slice --- ecs/src/query/options.rs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'ecs') diff --git a/ecs/src/query/options.rs b/ecs/src/query/options.rs index bbbe0a8..ead0ac7 100644 --- a/ecs/src/query/options.rs +++ b/ecs/src/query/options.rs @@ -7,16 +7,12 @@ use crate::EntityComponent; /// Query options. pub trait Options { - fn entity_filter<'component>( - components: impl IntoIterator, - ) -> bool; + fn entity_filter<'component>(components: &'component [EntityComponent]) -> bool; } impl Options for () { - fn entity_filter<'component>( - _: impl IntoIterator, - ) -> bool + fn entity_filter<'component>(_components: &'component [EntityComponent]) -> bool { true } @@ -33,9 +29,7 @@ impl Options for With where ComponentT: Component, { - fn entity_filter<'component>( - components: impl IntoIterator, - ) -> bool + fn entity_filter<'component>(components: &'component [EntityComponent]) -> bool { let ids_set = components .into_iter() @@ -57,9 +51,7 @@ impl Options for Not where OptionsT: Options, { - fn entity_filter<'component>( - components: impl IntoIterator, - ) -> bool + fn entity_filter<'component>(components: &'component [EntityComponent]) -> bool { !OptionsT::entity_filter(components) } -- cgit v1.2.3-18-g5258