diff --git a/src/bin.rs b/src/bin.rs index 54c85b2..a649562 100644 --- a/src/bin.rs +++ b/src/bin.rs @@ -143,6 +143,7 @@ impl Loopable for serde_json::Value { impl CompareContextElement for serde_json::Value { fn equals(&self, other: &dyn ContextElement) -> bool { + // println!("equals json {:?} | {:?}", self, other); // Handle other serde_json::Value match other.to_any().downcast_ref::() { None => (), @@ -156,15 +157,15 @@ impl CompareContextElement for serde_json::Value { _ => return self == other_json_value, }, } - // Handle string literals - match other.to_any().downcast_ref::() { + // Handle literals + match other.to_any().downcast_ref::() { None => (), - Some(other_string) => return self.as_str().map_or(false, |s| s == other_string), - } - // Handle numeric literals - match other.to_any().downcast_ref::() { - None => (), - Some(other_num) => return self.as_u64().map_or(false, |n| n == *other_num), + Some(OwnedLiteral::LString(other_string)) => { + return self.as_str().map_or(false, |s| s == other_string) + } + Some(OwnedLiteral::LPositiveInteger(other_num)) => { + return self.as_u64().map_or(false, |n| n == *other_num) + } } false } diff --git a/src/renderer/parameters_context.rs b/src/renderer/parameters_context.rs index 052ec4a..bc89624 100644 --- a/src/renderer/parameters_context.rs +++ b/src/renderer/parameters_context.rs @@ -160,6 +160,7 @@ impl Walkable for OwnedLiteral { impl CompareContextElement for OwnedLiteral { fn equals(&self, other: &dyn ContextElement) -> bool { + // println!("equals literal {:?} | {:?}", 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