summaryrefslogtreecommitdiff
path: root/ecs/src/query.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2025-04-08 17:19:30 +0200
committerHampusM <hampus@hampusmat.com>2025-04-08 17:19:30 +0200
commit7276f9c72f53f02820c3238f72d099221daf7afd (patch)
treed523d0c01a9cd35bcc44401b46d9c8d36bbb10c1 /ecs/src/query.rs
parente4818dd4f0a57a2c9af8859253f570607f64bb12 (diff)
refactor(ecs): replace optional components with Option query term
Diffstat (limited to 'ecs/src/query.rs')
-rw-r--r--ecs/src/query.rs11
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());