Running into lifetime issues.

This commit is contained in:
Tom Alexander 2020-05-10 14:53:12 -04:00
parent c8cf6a78a0
commit 7e0e776486
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 16 additions and 1 deletions

View File

@ -25,3 +25,9 @@ pub trait Loopable {
/// for each element of the array.
fn get_loop_elements(&self) -> Vec<&dyn ContextElement>;
}
impl PartialEq<dyn ContextElement> for dyn ContextElement {
fn eq(&self, other: &dyn ContextElement) -> bool {
todo!()
}
}

View File

@ -9,6 +9,7 @@ pub enum RenderError {
TemplateNotFound(String),
}
#[derive(PartialEq)]
pub enum WalkError {
CantWalk,
}

View File

@ -225,7 +225,7 @@ impl<'a> DustRenderer<'a> {
};
}
DustTag::DTHelperEquals(parameterized_block) => {
let param_map: HashMap<&'a str, &'a RValue<'a>> = parameterized_block
let param_map: HashMap<&str, &RValue<'a>> = parameterized_block
.params
.iter()
.map(|pair: &KVPair<'a>| (pair.key, &pair.value))
@ -245,6 +245,14 @@ impl<'a> DustRenderer<'a> {
RValue::RVPath(path) => walk_path(breadcrumbs, &path.keys),
},
};
// let x = WalkError::CantWalk;
// let y = WalkError::CantWalk;
// if x == y {
// panic!("placeholder");
// }
// if left_side.unwrap() == right_side.unwrap() {
// panic!("placeholder");
// }
}
_ => (), // TODO: Implement the rest
}