aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar lictex_ <lictex_steaven@outlook.com>2023-11-28 00:25:32 +0800
committerLibravatar GitHub <noreply@github.com>2023-11-27 17:25:32 +0100
commit80238d7f48fd86ef939e74df9fdc9678ee78a208 (patch)
treee10fade181d41cc66b071fa801bf228910877597
parenta13105fe082f638ffc2c689d8c0ccb23dceed034 (diff)
downloadaskama-80238d7f48fd86ef939e74df9fdc9678ee78a208.tar.gz
askama-80238d7f48fd86ef939e74df9fdc9678ee78a208.tar.bz2
askama-80238d7f48fd86ef939e74df9fdc9678ee78a208.zip
askama_axum: update axum to 0.7 (#918)
Diffstat (limited to '')
-rw-r--r--askama_axum/Cargo.toml11
-rw-r--r--askama_axum/tests/basic.rs3
2 files changed, 8 insertions, 6 deletions
diff --git a/askama_axum/Cargo.toml b/askama_axum/Cargo.toml
index 034d235..d566c1e 100644
--- a/askama_axum/Cargo.toml
+++ b/askama_axum/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "askama_axum"
-version = "0.3.0"
+version = "0.4.0"
edition = "2021"
rust-version = "1.65"
description = "Axum integration for Askama templates"
@@ -15,12 +15,13 @@ readme = "README.md"
[dependencies]
askama = { version = "0.12", path = "../askama", default-features = false, features = ["with-axum", "mime", "mime_guess"] }
-axum-core = "0.3"
-http = "0.2"
+axum-core = "0.4"
+http = "1.0"
[dev-dependencies]
-axum = { version = "0.6", default-features = false }
-hyper = { version = "0.14", features = ["full"] }
+axum = { version = "0.7", default-features = false }
+http-body-util = "0.1"
+hyper = { version = "1.0", features = ["full"] }
tokio = { version = "1.0", features = ["full"] }
tower = { version = "0.4", features = ["util"] }
diff --git a/askama_axum/tests/basic.rs b/askama_axum/tests/basic.rs
index acd53b7..3099dac 100644
--- a/askama_axum/tests/basic.rs
+++ b/askama_axum/tests/basic.rs
@@ -5,6 +5,7 @@ use axum::{
routing::get,
Router,
};
+use http_body_util::BodyExt;
use tower::util::ServiceExt;
#[derive(Template)]
@@ -30,6 +31,6 @@ async fn template_to_response() {
let headers = res.headers();
assert_eq!(headers["Content-Type"], "text/html; charset=utf-8");
- let body = hyper::body::to_bytes(res.into_body()).await.unwrap();
+ let body = res.into_body().collect().await.unwrap().to_bytes();
assert_eq!(&body[..], b"Hello, world!");
}