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

@ -1,7 +1,6 @@
use std::collections::HashMap;
use actix_web::{middleware, web, App, HttpServer, Responder, Result};
use actix_web_lab::respond::Html;
use askama::Template;
#[derive(Template)]
@ -27,7 +26,7 @@ async fn index(query: web::Query<HashMap<String, String>>) -> Result<impl Respon
Index.render().expect("template should be valid")
};
Ok(Html(html))
Ok(web::Html::new(html))
}
#[actix_web::main]