Support axum v0.7 through axum-core v0.4 and http v1 ()

* chore: bump `axum-core` for use with new `axum` 0.7 release

* chore: bump doctest axum too

* chore: update changelog

* chore: fix changelog

* fix: doctest

* fix: import right resp type

* fix: bump http as well

* fix: doctest

* Update CHANGELOG.md
This commit is contained in:
Vidhan Bhatt 2023-12-30 14:36:47 +05:30 committed by GitHub
parent 8318963db7
commit d3b871189f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 10 deletions

View file

@ -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

View file

@ -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();
}
```

View file

@ -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"

View file

@ -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"] }

View file

@ -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<String> {
fn into_response(self) -> Response<BoxBody> {
fn into_response(self) -> Response {
let mut headers = HeaderMap::new();
headers.insert(
header::CONTENT_TYPE,