From b714e1f4ce5e17d56fed840c471516c3b47ea6b3 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Wed, 27 Dec 2017 19:29:04 -0800 Subject: [PATCH] fix example --- examples/template_tera/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/template_tera/src/main.rs b/examples/template_tera/src/main.rs index 1925ad4e..946c78bf 100644 --- a/examples/template_tera/src/main.rs +++ b/examples/template_tera/src/main.rs @@ -12,7 +12,7 @@ struct State { fn index(req: HttpRequest) -> Result { let s = if let Some(name) = req.query().get("name") { // <- submitted form let mut ctx = tera::Context::new(); - ctx.add("name", name); + ctx.add("name", &name.to_owned()); ctx.add("text", &"Welcome!".to_owned()); req.state().template.render("user.html", &ctx) .map_err(|_| error::ErrorInternalServerError("Template error"))?