Skip to content

Commit

Permalink
feat(server-auto): make http1 and http2 feature optional
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed Mar 2, 2024
1 parent 370e798 commit 3399567
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ edition = "2021"
features = ["full"]
rustdoc-args = ["--cfg", "docsrs"]

[patch.crates-io]
hyper = { git = "https://github.com/hyperium/hyper", rev = "refs/pull/3591/head" }

[dependencies]
hyper = "1.2.0"
futures-util = { version = "0.3.16", default-features = false }
futures-util = { version = "0.3.16", default-features = false, optional = true }
http = "1.0"
http-body = "1.0.0"
bytes = "1"
Expand All @@ -31,6 +34,7 @@ tower-service ={ version = "0.3", optional = true }
tower = { version = "0.4.1", optional = true, features = ["make", "util"] }

[dev-dependencies]
futures-util = { version = "0.3.16", default-features = false }
hyper = { version = "1.2.0", features = ["full"] }
bytes = "1"
http-body-util = "0.1.0"
Expand All @@ -57,10 +61,10 @@ full = [
]

client = ["hyper/client", "dep:tracing", "dep:futures-channel", "dep:tower", "dep:tower-service"]
client-legacy = ["client", "dep:socket2"]
client-legacy = ["client", "dep:futures-util", "dep:socket2"]

server = ["hyper/server"]
server-auto = ["server", "http1", "http2"]
server-auto = ["server", "dep:futures-util"]

service = ["dep:tower", "dep:tower-service"]

Expand All @@ -75,4 +79,3 @@ __internal_happy_eyeballs_tests = []
[[example]]
name = "client"
required-features = ["client-legacy", "http1", "tokio"]

2 changes: 1 addition & 1 deletion src/server/conn/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Connection utilities.
#[cfg(any(feature = "http1", feature = "http2"))]
#[cfg(feature = "server-auto")]
pub mod auto;

0 comments on commit 3399567

Please sign in to comment.