Generic implementation of CompareContextElement.
This commit is contained in:
13
src/bin.rs
13
src/bin.rs
@@ -140,16 +140,3 @@ impl Loopable for serde_json::Value {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl CompareContextElement for serde_json::Value {
|
||||
fn to_any(&self) -> &dyn Any {
|
||||
self
|
||||
}
|
||||
|
||||
fn equals(&self, other: &dyn ContextElement) -> bool {
|
||||
other
|
||||
.to_any()
|
||||
.downcast_ref::<Self>()
|
||||
.map_or(false, |a| self == a)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user