Skip to content

Commit

Permalink
refactor(lib): Clean up cfg usage
Browse files Browse the repository at this point in the history
  • Loading branch information
jplatte authored and seanmonstar committed Aug 31, 2021
1 parent 07f9208 commit db57316
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 18 deletions.
7 changes: 1 addition & 6 deletions src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ pub(crate) mod watch;

#[cfg(all(feature = "client", any(feature = "http1", feature = "http2")))]
pub(crate) use self::lazy::{lazy, Started as Lazy};
#[cfg(any(
feature = "client",
feature = "http1",
feature = "http2",
feature = "runtime"
))]
#[cfg(any(feature = "http1", feature = "http2", feature = "runtime"))]
pub(crate) use self::never::Never;
pub(crate) use self::task::Poll;

Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ cfg_proto! {
}

cfg_feature! {
#![all(feature = "client")]
#![feature = "client"]

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

cfg_feature! {
#![all(feature = "server")]
#![feature = "server"]

pub mod server;
#[cfg(any(feature = "http1", feature = "http2"))]
Expand Down
8 changes: 2 additions & 6 deletions src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,6 @@ cfg_feature! {
pub mod conn;
mod server;
mod shutdown;

cfg_feature! {
#![feature = "tcp"]

mod tcp;
}
#[cfg(feature = "tcp")]
mod tcp;
}
6 changes: 2 additions & 4 deletions src/server/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,7 @@ impl<I, E> Builder<I, E> {
/// # Cargo Feature
///
/// Requires the `runtime` cargo feature to be enabled.
#[cfg(feature = "runtime")]
#[cfg(feature = "http2")]
#[cfg(all(feature = "runtime", feature = "http2"))]
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
pub fn http2_keep_alive_interval(mut self, interval: impl Into<Option<Duration>>) -> Self {
self.protocol.http2_keep_alive_interval(interval);
Expand All @@ -371,8 +370,7 @@ impl<I, E> Builder<I, E> {
/// # Cargo Feature
///
/// Requires the `runtime` cargo feature to be enabled.
#[cfg(feature = "runtime")]
#[cfg(feature = "http2")]
#[cfg(all(feature = "runtime", feature = "http2"))]
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
pub fn http2_keep_alive_timeout(mut self, timeout: Duration) -> Self {
self.protocol.http2_keep_alive_timeout(timeout);
Expand Down

0 comments on commit db57316

Please sign in to comment.