diff options
author | HampusM <hampus@hampusmat.com> | 2025-04-08 17:19:30 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2025-04-08 17:19:30 +0200 |
commit | 7276f9c72f53f02820c3238f72d099221daf7afd (patch) | |
tree | d523d0c01a9cd35bcc44401b46d9c8d36bbb10c1 /ecs/src/query.rs | |
parent | e4818dd4f0a57a2c9af8859253f570607f64bb12 (diff) |
refactor(ecs): replace optional components with Option query term
Diffstat (limited to 'ecs/src/query.rs')
-rw-r--r-- | ecs/src/query.rs | 11 |
1 files changed, 0 insertions, 11 deletions
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<ComponentT: Component>(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<ComponentT: Component>(mut self) -> Self { - if ComponentT::is_optional() { - panic!( - "{}::without cannot take optional component", - type_name::<Self>() - ); - } - let insert_index = self.excluded_components .partition_point(|id| *id <= ComponentT::id()); |