sunng87 / handlebars-rust

Rust templating with Handlebars

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quick-start fails with cannot find trait `Error` in this scope

szabgab opened this issue · comments

I created a project, update Cargo.toml with

[dependencies]
handlebars = "4.3.7"
serde_json = "1.0.97"

and got this error

$ cargo run
   Compiling proc-macro2 v1.0.60
   Compiling unicode-ident v1.0.9
   Compiling quote v1.0.28
   Compiling thiserror v1.0.40
   Compiling ucd-trie v0.1.5
   Compiling serde v1.0.164
   Compiling once_cell v1.18.0
   Compiling serde_json v1.0.97
   Compiling itoa v1.0.6
   Compiling ryu v1.0.13
   Compiling log v0.4.19
   Compiling syn v2.0.18
   Compiling thiserror-impl v1.0.40
   Compiling pest v2.7.0
   Compiling pest_meta v2.7.0
   Compiling pest_generator v2.7.0
   Compiling pest_derive v2.7.0
   Compiling handlebars v4.3.7
   Compiling handlebars-quick v0.1.0 (/home/gabor/work/slides/rust/examples/handlebars-quick)
error[E0405]: cannot find trait `Error` in this scope
 --> src/main.rs:4:33
  |
4 | fn main() -> Result<(), Box<dyn Error>> {
  |                                 ^^^^^ not found in this scope
  |
help: consider importing one of these items
  |
1 + use core::error::Error;
  |
1 + use std::error::Error;
  |

For more information about this error, try `rustc --explain E0405`.
error: could not compile `handlebars-quick` (bin "handlebars-quick") due to previous error