From e9f2b9b91d72322ec2e063ce7b83415071306468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20H=C3=B6lting?= <87192362+moritz-hoelting@users.noreply.github.com> Date: Wed, 12 Mar 2025 13:05:20 +0100 Subject: [PATCH] remove double nested not's in result of condition truth table generation --- src/datapack/command/execute/conditional.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/datapack/command/execute/conditional.rs b/src/datapack/command/execute/conditional.rs index 231bc3b..e6a793d 100644 --- a/src/datapack/command/execute/conditional.rs +++ b/src/datapack/command/execute/conditional.rs @@ -439,7 +439,7 @@ impl Condition { #[must_use] pub fn to_truth_table(&self) -> Vec { match self.normalize() { - Self::Atom(_) | Self::Not(_) => vec![self.clone()], + Self::Atom(_) | Self::Not(_) => vec![self.normalize()], Self::Or(a, b) => a .to_truth_table() .into_iter() @@ -461,7 +461,7 @@ impl Condition { /// Convert the condition into a [`MacroString`]. /// - /// Will fail if the condition contains an `Or` variant. Use `compile` instead. + /// Will fail if the condition contains an `Or` or double nested `Not` variant. Use `compile` instead. fn str_cond(&self) -> Option { match self { Self::Atom(s) => Some(MacroString::from("if ") + s.clone()),