1
0
mirror of https://github.com/actix/examples synced 2025-06-26 17:17:42 +02:00

refactor: use graduated Html responder

This commit is contained in:
Rob Ede
2024-07-07 00:23:03 +01:00
parent 10aff3cdb1
commit a67c7803e6
13 changed files with 27 additions and 40 deletions

View File

@ -8,7 +8,6 @@ use actix_web::{
middleware::{self, ErrorHandlerResponse, ErrorHandlers},
web, App, Error, HttpResponse, HttpServer, Responder, Result,
};
use actix_web_lab::respond::Html;
use tera::Tera;
// store tera template in application state
@ -28,7 +27,7 @@ async fn index(
.map_err(|_| error::ErrorInternalServerError("Template error"))?
};
Ok(Html(s))
Ok(web::Html::new(s))
}
#[actix_web::main]