Add that check to the not-equals helper and update the json value implementation to mark all non-scalars as not-equals.
This commit is contained in:
@@ -285,6 +285,20 @@ impl<'a> DustRenderer<'a> {
|
||||
.iter()
|
||||
.map(|pair: &KVPair<'a>| (pair.key, &pair.value))
|
||||
.collect();
|
||||
// Special case: when comparing two RVPaths, if the
|
||||
// path is equal then dust assumes the values are
|
||||
// equal (otherwise, non-scalar values are
|
||||
// automatically not equal)
|
||||
if Self::are_paths_identical(¶m_map) {
|
||||
return match ¶meterized_block.else_contents {
|
||||
None => Ok("".to_owned()),
|
||||
Some(body) => {
|
||||
let rendered_content = self.render_body(body, breadcrumbs, blocks)?;
|
||||
Ok(rendered_content)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
let left_side: Result<&dyn ContextElement, WalkError> = match param_map.get("key") {
|
||||
None => return Ok("".to_owned()),
|
||||
Some(rval) => match rval {
|
||||
|
||||
Reference in New Issue
Block a user