diff --git a/src/bin.rs b/src/bin.rs index fdde0a1..9669d2e 100644 --- a/src/bin.rs +++ b/src/bin.rs @@ -336,6 +336,7 @@ impl Castable for serde_json::Value { impl CompareContextElement for serde_json::Value { fn equals(&self, other: &dyn ContextElement) -> bool { + // println!("Json equality check {:?} == {:?}", self, other); // Handle other serde_json::Value match other.to_any().downcast_ref::() { None => (), diff --git a/src/renderer/parameters_context.rs b/src/renderer/parameters_context.rs index 4dabd9a..461b732 100644 --- a/src/renderer/parameters_context.rs +++ b/src/renderer/parameters_context.rs @@ -202,6 +202,7 @@ impl Castable for OwnedLiteral { impl CompareContextElement for OwnedLiteral { fn equals(&self, other: &dyn ContextElement) -> bool { + // println!("Literal equality check {:?} == {:?}", self, other); // If its an OwnedLiteral then compare them directly, // otherwise defer to the other type's implementation of // CompareContextElement since the end user could add any @@ -220,27 +221,12 @@ impl CompareContextElement for OwnedLiteral { OwnedLiteral::LNegativeInteger(self_num), OwnedLiteral::LNegativeInteger(other_num), ) => self_num == other_num, + (OwnedLiteral::LString(self_text), _) | (_, OwnedLiteral::LString(self_text)) => { + false + } (OwnedLiteral::LFloat(self_num), OwnedLiteral::LFloat(other_num)) => { self_num == other_num } - (OwnedLiteral::LPositiveInteger(self_num), OwnedLiteral::LString(other_text)) => { - &self_num.to_string() == other_text - } - (OwnedLiteral::LString(self_text), OwnedLiteral::LPositiveInteger(other_num)) => { - self_text == &other_num.to_string() - } - (OwnedLiteral::LNegativeInteger(self_num), OwnedLiteral::LString(other_text)) => { - &self_num.to_string() == other_text - } - (OwnedLiteral::LString(self_text), OwnedLiteral::LNegativeInteger(other_num)) => { - self_text == &other_num.to_string() - } - (OwnedLiteral::LFloat(self_num), OwnedLiteral::LString(other_text)) => { - &self_num.to_string() == other_text - } - (OwnedLiteral::LString(self_text), OwnedLiteral::LFloat(other_num)) => { - self_text == &other_num.to_string() - } (OwnedLiteral::LFloat(self_num), OwnedLiteral::LPositiveInteger(other_num)) => { *self_num == (*other_num as f64) }