diff --git a/CHANGELOG.md b/CHANGELOG.md index 60f636d2..0e5f58f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ [#380](https://github.com/lambda-fairy/maud/pull/380) - Accept literals in attribute names [#396](https://github.com/lambda-fairy/maud/pull/396) +- Support `axum` v0.7 through `axum-core` v0.4 and `http` v1 + [#401](https://github.com/lambda-fairy/maud/pull/401) ## [0.25.0] - 2023-04-16 diff --git a/docs/content/web-frameworks.md b/docs/content/web-frameworks.md index 3579f1af..c81bf5a6 100644 --- a/docs/content/web-frameworks.md +++ b/docs/content/web-frameworks.md @@ -167,9 +167,8 @@ async fn main() { let app = Router::new().route("/", get(hello_world)); // run it with hyper on localhost:3000 - axum::Server::bind(&"0.0.0.0:3000".parse().unwrap()) - .serve(app.into_make_service()) - .await - .unwrap(); + let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap(); + + axum::serve(listener, app.into_make_service()).await.unwrap(); } ``` diff --git a/doctest/Cargo.toml b/doctest/Cargo.toml index 35df0a43..ee2794c4 100644 --- a/doctest/Cargo.toml +++ b/doctest/Cargo.toml @@ -13,7 +13,7 @@ rocket = "0.4" rouille = "3" tide = "0.16" tokio = { version = "1.9.0", features = ["rt", "macros", "rt-multi-thread"] } -axum = "0.6" +axum = "0.7" [dependencies.async-std] version = "1.9.0" diff --git a/maud/Cargo.toml b/maud/Cargo.toml index d9088537..16d9a9b8 100644 --- a/maud/Cargo.toml +++ b/maud/Cargo.toml @@ -25,8 +25,8 @@ rocket = { version = ">= 0.3, < 0.5", optional = true } futures-util = { version = "0.3.0", optional = true, default-features = false } actix-web-dep = { package = "actix-web", version = "4", optional = true, default-features = false } tide = { version = "0.16.0", optional = true, default-features = false } -axum-core = { version = "0.3", optional = true } -http = { version = "0.2", optional = true } +axum-core = { version = "0.4", optional = true } +http = { version = "1", optional = true } [dev-dependencies] trybuild = { version = "1.0.33", features = ["diff"] } diff --git a/maud/src/lib.rs b/maud/src/lib.rs index 53aa3fa9..02de568c 100644 --- a/maud/src/lib.rs +++ b/maud/src/lib.rs @@ -338,11 +338,11 @@ mod tide_support { mod axum_support { use crate::PreEscaped; use alloc::string::String; - use axum_core::{body::BoxBody, response::IntoResponse}; - use http::{header, HeaderMap, HeaderValue, Response}; + use axum_core::response::{IntoResponse, Response}; + use http::{header, HeaderMap, HeaderValue}; impl IntoResponse for PreEscaped { - fn into_response(self) -> Response { + fn into_response(self) -> Response { let mut headers = HeaderMap::new(); headers.insert( header::CONTENT_TYPE,