Skip to content

Commit

Permalink
(doc) update code example in README
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 committed May 23, 2021
1 parent c9a1f19 commit 0e6da88
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ book](https://doc.rust-lang.org/book/).
### Quick Start

```rust
extern crate handlebars;
#[macro_use]
extern crate serde_json;

use handlebars::Handlebars;
use serde_json::json;

fn main() -> Result<(), Box<dyn Error>> {
let mut reg = Handlebars::new();
Expand All @@ -38,6 +35,7 @@ fn main() -> Result<(), Box<dyn Error>> {
// register template using given name
reg.register_template_string("tpl_1", "Good afternoon, {{name}}")?;
println!("{}", reg.render("tpl_1", &json!({"name": "foo"}))?);

Ok(())
}
```
Expand Down

0 comments on commit 0e6da88

Please sign in to comment.