diff --git a/src/renderer/context_element.rs b/src/renderer/context_element.rs index 0b1c304..3db0f27 100644 --- a/src/renderer/context_element.rs +++ b/src/renderer/context_element.rs @@ -54,19 +54,6 @@ impl CastToAny for C { } } -// impl CompareContextElement for C { -// fn to_any(&self) -> &dyn Any { -// self -// } - -// fn equals(&self, other: &dyn ContextElement) -> bool { -// other -// .to_any() -// .downcast_ref::() -// .map_or(false, |a| self == a) -// } -// } - impl<'a, 'b> PartialEq<&'b dyn ContextElement> for &'a dyn ContextElement { fn eq(&self, other: &&'b dyn ContextElement) -> bool { self.equals(*other) diff --git a/src/renderer/parameters_context.rs b/src/renderer/parameters_context.rs index af08de0..b2081d6 100644 --- a/src/renderer/parameters_context.rs +++ b/src/renderer/parameters_context.rs @@ -119,58 +119,6 @@ impl CompareContextElement for NewParametersContext { } } -// #[derive(Clone, Debug)] -// pub struct ParametersContext<'a> { -// params: HashMap<&'a str, &'a RValue<'a>>, -// breadcrumbs: &'a Vec<&'a dyn ContextElement>, -// } - -// impl<'a> ParametersContext<'a> { -// pub fn new( -// breadcrumbs: &'a Vec<&'a dyn ContextElement>, -// params: &'a Vec>, -// ) -> ParametersContext<'a> { -// let param_map = params -// .iter() -// .map(|pair: &KVPair<'a>| (pair.key, &pair.value)) -// .collect(); -// ParametersContext { -// params: param_map, -// breadcrumbs: breadcrumbs, -// } -// } -// } - -// impl<'a> ContextElement for ParametersContext<'a> {} - -// impl<'a> Renderable for ParametersContext<'a> { -// fn render(&self, _filters: &Vec) -> Result { -// // TODO: Would this even ever be called? Won't matter, but I'd -// // like to know. Since it is injected 1 above the current -// // context, we wouldn't be able to access it with `{.}`. -// Ok("[object Object]".to_owned()) -// } -// } - -// impl<'a> Loopable for ParametersContext<'a> { -// fn get_loop_elements(&self) -> Vec<&dyn ContextElement> { -// // TODO: Would this even ever be called? Won't matter, but I'd -// // like to know. Since it is injected 1 above the current -// // context, we wouldn't be able to access it with `{.}`. -// vec![self] -// } -// } - -// impl<'a> Walkable for ParametersContext<'a> { -// fn walk(&self, segment: &str) -> Result<&dyn ContextElement, WalkError> { -// let rval = self.params.get(segment).ok_or(WalkError::CantWalk)?; -// match rval { -// RValue::RVPath(path) => walk_path(self.breadcrumbs, &path.keys), -// RValue::RVString(text) => Ok(text), -// } -// } -// } - impl ContextElement for String {} impl Renderable for String {