use std::error::Error; use handbar::Handbar; use serde_json::json; fn main() -> Result<(), Box> { let mut reg = Handbar::new(); // render without register println!( "{}", reg.render_template("Hello {{name}}", &json!({"name": "foo"}))? ); // register template using given name reg.register_template_string("tpl_1", "Good afternoon, {{name}}")?; println!("{}", reg.render("tpl_1", &json!({"name": "foo"}))?); Ok(()) }