Skip to content

Commit db57316

Browse files
jplatteseanmonstar
authored andcommitted
refactor(lib): Clean up cfg usage
1 parent 07f9208 commit db57316

File tree

4 files changed

+7
-18
lines changed

4 files changed

+7
-18
lines changed

src/common/mod.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@ pub(crate) mod watch;
2525

2626
#[cfg(all(feature = "client", any(feature = "http1", feature = "http2")))]
2727
pub(crate) use self::lazy::{lazy, Started as Lazy};
28-
#[cfg(any(
29-
feature = "client",
30-
feature = "http1",
31-
feature = "http2",
32-
feature = "runtime"
33-
))]
28+
#[cfg(any(feature = "http1", feature = "http2", feature = "runtime"))]
3429
pub(crate) use self::never::Never;
3530
pub(crate) use self::task::Poll;
3631

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ cfg_proto! {
9393
}
9494

9595
cfg_feature! {
96-
#![all(feature = "client")]
96+
#![feature = "client"]
9797

9898
pub mod client;
9999
#[cfg(any(feature = "http1", feature = "http2"))]
@@ -102,7 +102,7 @@ cfg_feature! {
102102
}
103103

104104
cfg_feature! {
105-
#![all(feature = "server")]
105+
#![feature = "server"]
106106

107107
pub mod server;
108108
#[cfg(any(feature = "http1", feature = "http2"))]

src/server/mod.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,6 @@ cfg_feature! {
157157
pub mod conn;
158158
mod server;
159159
mod shutdown;
160-
161-
cfg_feature! {
162-
#![feature = "tcp"]
163-
164-
mod tcp;
165-
}
160+
#[cfg(feature = "tcp")]
161+
mod tcp;
166162
}

src/server/server.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,7 @@ impl<I, E> Builder<I, E> {
353353
/// # Cargo Feature
354354
///
355355
/// Requires the `runtime` cargo feature to be enabled.
356-
#[cfg(feature = "runtime")]
357-
#[cfg(feature = "http2")]
356+
#[cfg(all(feature = "runtime", feature = "http2"))]
358357
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
359358
pub fn http2_keep_alive_interval(mut self, interval: impl Into<Option<Duration>>) -> Self {
360359
self.protocol.http2_keep_alive_interval(interval);
@@ -371,8 +370,7 @@ impl<I, E> Builder<I, E> {
371370
/// # Cargo Feature
372371
///
373372
/// Requires the `runtime` cargo feature to be enabled.
374-
#[cfg(feature = "runtime")]
375-
#[cfg(feature = "http2")]
373+
#[cfg(all(feature = "runtime", feature = "http2"))]
376374
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
377375
pub fn http2_keep_alive_timeout(mut self, timeout: Duration) -> Self {
378376
self.protocol.http2_keep_alive_timeout(timeout);

0 commit comments

Comments
 (0)