refactor: Used askama_axum::Template
docs: https://djc.github.io/askama/integrations.html#axum-integration
This commit is contained in:
@ -1,10 +1,9 @@
|
||||
use askama::Template;
|
||||
use askama_axum::IntoResponse;
|
||||
use askama_axum::Template;
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "pages/cps.html")]
|
||||
struct CpsResponse;
|
||||
pub struct CpsTemplate;
|
||||
|
||||
pub async fn cps() -> impl IntoResponse {
|
||||
CpsResponse.into_response()
|
||||
pub async fn cps() -> CpsTemplate {
|
||||
CpsTemplate
|
||||
}
|
||||
|
@ -1,10 +1,9 @@
|
||||
use askama::Template;
|
||||
use askama_axum::IntoResponse;
|
||||
use askama_axum::Template;
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "pages/home.html")]
|
||||
struct HomeResponse;
|
||||
pub struct HomeTemplate;
|
||||
|
||||
pub async fn home() -> impl IntoResponse {
|
||||
HomeResponse.into_response()
|
||||
pub async fn home() -> HomeTemplate {
|
||||
HomeTemplate
|
||||
}
|
||||
|
Reference in New Issue
Block a user