Compiles again.
This commit is contained in:
@@ -39,8 +39,9 @@ impl<'a> Renderable for ParametersContext<'a> {
|
||||
}
|
||||
|
||||
impl<'a> Loopable for ParametersContext<'a> {
|
||||
fn get_loop_elements(&self) -> Result<Vec<&dyn ContextElement>, RenderError> {
|
||||
Ok(vec![self])
|
||||
fn get_loop_elements(&self) -> Vec<&dyn ContextElement> {
|
||||
// TODO: Would this even ever be called? Won't matter, but I'd like to know.
|
||||
vec![self]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ impl<'a> DustRenderer<'a> {
|
||||
match val {
|
||||
Err(WalkError::CantWalk) => return Ok("".to_owned()),
|
||||
Ok(final_val) => {
|
||||
let loop_elements = final_val.get_loop_elements()?;
|
||||
let loop_elements = final_val.get_loop_elements();
|
||||
if loop_elements.is_empty() {
|
||||
return Ok("".to_owned());
|
||||
} else {
|
||||
@@ -115,7 +115,7 @@ impl<'a> DustRenderer<'a> {
|
||||
}
|
||||
DustTag::DTSection(container) => {
|
||||
let val = walk_path(breadcrumbs, &container.path.keys);
|
||||
let loop_elements: Vec<&dyn ContextElement> = self.get_loop_elements(val)?;
|
||||
let loop_elements: Vec<&dyn ContextElement> = self.get_loop_elements(val);
|
||||
if loop_elements.is_empty() {
|
||||
// Oddly enough if the value is falsey (like
|
||||
// an empty array or null), Dust uses the
|
||||
@@ -145,7 +145,7 @@ impl<'a> DustRenderer<'a> {
|
||||
}
|
||||
DustTag::DTExists(container) => {
|
||||
let val = walk_path(breadcrumbs, &container.path.keys);
|
||||
let loop_elements: Vec<&dyn ContextElement> = self.get_loop_elements(val)?;
|
||||
let loop_elements: Vec<&dyn ContextElement> = self.get_loop_elements(val);
|
||||
if loop_elements.is_empty() {
|
||||
return match &container.else_contents {
|
||||
Some(body) => self.render_body(&body, breadcrumbs),
|
||||
@@ -160,7 +160,7 @@ impl<'a> DustRenderer<'a> {
|
||||
}
|
||||
DustTag::DTNotExists(container) => {
|
||||
let val = walk_path(breadcrumbs, &container.path.keys);
|
||||
let loop_elements: Vec<&dyn ContextElement> = self.get_loop_elements(val)?;
|
||||
let loop_elements: Vec<&dyn ContextElement> = self.get_loop_elements(val);
|
||||
if !loop_elements.is_empty() {
|
||||
return match &container.else_contents {
|
||||
Some(body) => self.render_body(&body, breadcrumbs),
|
||||
|
||||
Reference in New Issue
Block a user