Skip to content

Commit

Permalink
Merge pull request #50 from ibabushkin/master
Browse files Browse the repository at this point in the history
Added truthy interpretation of nonempty strings
  • Loading branch information
erickt authored Jun 22, 2017
2 parents 7e6edb3 + 1bd7ebf commit a05c6aa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,13 @@ impl<'a> RenderContext<'a> {
stack.pop();
}
}
_ => bug!("unexpected value {:?}", value),
StrVal(ref val) => {
if val != "" {
stack.push(value);
try!(self.render(wr, stack, children));
stack.pop();
}
}
}
}
};
Expand Down

0 comments on commit a05c6aa

Please sign in to comment.