tentatively seems to be working.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use crate::parser::KVPair;
|
||||
use crate::parser::{Filter, RValue};
|
||||
use crate::renderer::context_element::CompareContextElement;
|
||||
use crate::renderer::context_element::ContextElement;
|
||||
use crate::renderer::context_element::IntoBoxedContextElement;
|
||||
use crate::renderer::walking::walk_path;
|
||||
@@ -8,6 +9,7 @@ use crate::renderer::RenderError;
|
||||
use crate::renderer::Renderable;
|
||||
use crate::renderer::WalkError;
|
||||
use crate::renderer::Walkable;
|
||||
use std::any::Any;
|
||||
use std::collections::HashMap;
|
||||
|
||||
/// Copy the data from an RValue to an Owned struct
|
||||
@@ -146,3 +148,16 @@ impl IntoBoxedContextElement for String {
|
||||
Box::new(self.clone())
|
||||
}
|
||||
}
|
||||
|
||||
impl CompareContextElement for String {
|
||||
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