Skip to content

Commit

Permalink
Remove h2 from dependencies when http2 feature is off (#2605)
Browse files Browse the repository at this point in the history
  • Loading branch information
mladedav committed Mar 16, 2024
1 parent 8b13d4c commit 2ce382f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions axum/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- **fixed:** Fixed layers being cloned when calling `axum::serve` directly with
a `Router` or `MethodRouter` ([#2586])
- **fixed:** `h2` is no longer pulled as a dependency unless the `http2` feature
is enabled ([#2605])

[#2586]: https://github.com/tokio-rs/axum/pull/2586
[#2605]: https://github.com/tokio-rs/axum/pull/2605

# 0.7.4 (13. January, 2024)

Expand Down
6 changes: 3 additions & 3 deletions axum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ default = [
"tracing",
]
form = ["dep:serde_urlencoded"]
http1 = ["dep:hyper", "hyper?/http1"]
http2 = ["dep:hyper", "hyper?/http2"]
http1 = ["dep:hyper", "hyper?/http1", "hyper-util?/http1"]
http2 = ["dep:hyper", "hyper?/http2", "hyper-util?/http2"]
json = ["dep:serde_json", "dep:serde_path_to_error"]
macros = ["dep:axum-macros"]
matched-path = []
Expand Down Expand Up @@ -64,7 +64,7 @@ tower-service = "0.3"
axum-macros = { path = "../axum-macros", version = "0.4.1", optional = true }
base64 = { version = "0.21.0", optional = true }
hyper = { version = "1.1.0", optional = true }
hyper-util = { version = "0.1.2", features = ["tokio", "server", "server-auto"], optional = true }
hyper-util = { version = "0.1.3", features = ["tokio", "server"], optional = true }
multer = { version = "3.0.0", optional = true }
serde_json = { version = "1.0", features = ["raw_value"], optional = true }
serde_path_to_error = { version = "0.1.8", optional = true }
Expand Down
7 changes: 3 additions & 4 deletions axum/src/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ use std::{
use axum_core::{body::Body, extract::Request, response::Response};
use futures_util::{pin_mut, FutureExt};
use hyper::body::Incoming;
use hyper_util::{
rt::{TokioExecutor, TokioIo},
server::conn::auto::Builder,
};
use hyper_util::rt::{TokioExecutor, TokioIo};
#[cfg(any(feature = "http1", feature = "http2"))]
use hyper_util::server::conn::auto::Builder;
use pin_project_lite::pin_project;
use tokio::{
net::{TcpListener, TcpStream},
Expand Down

0 comments on commit 2ce382f

Please sign in to comment.