From 7276f9c72f53f02820c3238f72d099221daf7afd Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 8 Apr 2025 17:19:30 +0200 Subject: refactor(ecs): replace optional components with Option query term --- ecs/src/query.rs | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'ecs/src/query.rs') diff --git a/ecs/src/query.rs b/ecs/src/query.rs index f642156..7542f0d 100644 --- a/ecs/src/query.rs +++ b/ecs/src/query.rs @@ -198,10 +198,6 @@ impl_terms_builder! { #[allow(unused_mut)] fn with(mut self) -> Self { - if ComponentT::is_optional() { - return self; - } - let insert_index = self.required_components .partition_point(|id| *id <= ComponentT::id()); @@ -214,13 +210,6 @@ impl_terms_builder! { #[allow(unused_mut)] fn without(mut self) -> Self { - if ComponentT::is_optional() { - panic!( - "{}::without cannot take optional component", - type_name::() - ); - } - let insert_index = self.excluded_components .partition_point(|id| *id <= ComponentT::id()); -- cgit v1.2.3-18-g5258