From d77553d826f3c90999e0dd84f35cac3690c3d0ca Mon Sep 17 00:00:00 2001 From: Michael Alyn Miller Date: Sat, 4 Dec 2021 16:49:06 -0800 Subject: Update axum to 0.4 (by switching to axum-core) --- askama_axum/src/lib.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'askama_axum/src/lib.rs') diff --git a/askama_axum/src/lib.rs b/askama_axum/src/lib.rs index 0c21464..859b19e 100644 --- a/askama_axum/src/lib.rs +++ b/askama_axum/src/lib.rs @@ -1,13 +1,14 @@ #![deny(elided_lifetimes_in_paths)] pub use askama::*; -use axum::{ - self, - body::{Bytes, Full}, - http::{Response, StatusCode}, -}; +use axum_core::body; +pub use axum_core::body::BoxBody; +pub use axum_core::response::IntoResponse; +pub use http::Response; +use http::StatusCode; +use http_body::{Empty, Full}; -pub fn into_response(t: &T, ext: &str) -> axum::http::Response> { +pub fn into_response(t: &T, ext: &str) -> Response { match t.render() { Ok(body) => Response::builder() .status(StatusCode::OK) @@ -15,11 +16,11 @@ pub fn into_response(t: &T, ext: &str) -> axum::http::Response Response::builder() .status(StatusCode::INTERNAL_SERVER_ERROR) - .body(vec![].into()) + .body(body::boxed(Empty::new())) .unwrap(), } } -- cgit