Function gtmpl::funcs::or [] [src]

pub fn or(args: &[Arc<Any>]) -> Result<Arc<Any>, String>

Returns the boolean OR of its arguments by returning the first non-empty argument or the last argument, that is, "or x y" behaves as "if x then x else y". All the arguments are evaluated.

Example

use gtmpl::template;
let equal = template("{{ or 1 2.0 false . }}", "foo");
assert_eq!(&equal.unwrap(), "1");