1
0
mirror of https://github.com/actix/examples synced 2025-06-28 09:50:36 +02:00

Update tera to 1.0 (#212)

This commit is contained in:
Yuki Okushi
2019-12-19 03:25:56 +09:00
committed by GitHub
parent b12b006c03
commit 7b35cd32c7
5 changed files with 6 additions and 10 deletions

View File

@ -17,7 +17,7 @@ log = "0.4.3"
serde = "1.0.69"
serde_derive = "1.0.69"
serde_json = "1.0.22"
tera = "0.11.8"
tera = "1.0"
[dependencies.diesel]
features = ["postgres", "r2d2"]

View File

@ -26,7 +26,7 @@ pub async fn index(
let rendered = tmpl
.render("index.html.tera", &context)
.map_err(|e| error::ErrorInternalServerError(e.description().to_owned()))?;
.map_err(|e| error::ErrorInternalServerError(e))?;
Ok(HttpResponse::Ok().body(rendered))
}

View File

@ -4,8 +4,6 @@ extern crate diesel;
extern crate log;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate tera;
use std::{env, io};
@ -37,7 +35,7 @@ async fn main() -> io::Result<()> {
let app = move || {
debug!("Constructing the App");
let templates: Tera = compile_templates!("templates/**/*");
let templates: Tera = Tera::new("/templates/**/*").unwrap();
let session_store = CookieSession::signed(SESSION_SIGNING_KEY).secure(false);