refactor(lib): Clean up cfg usage
This commit is contained in:
committed by
Sean McArthur
parent
07f9208714
commit
db57316e14
@@ -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;
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ cfg_proto! {
|
||||
}
|
||||
|
||||
cfg_feature! {
|
||||
#![all(feature = "client")]
|
||||
#![feature = "client"]
|
||||
|
||||
pub mod client;
|
||||
#[cfg(any(feature = "http1", feature = "http2"))]
|
||||
@@ -102,7 +102,7 @@ cfg_feature! {
|
||||
}
|
||||
|
||||
cfg_feature! {
|
||||
#![all(feature = "server")]
|
||||
#![feature = "server"]
|
||||
|
||||
pub mod server;
|
||||
#[cfg(any(feature = "http1", feature = "http2"))]
|
||||
|
||||
@@ -157,10 +157,6 @@ cfg_feature! {
|
||||
pub mod conn;
|
||||
mod server;
|
||||
mod shutdown;
|
||||
|
||||
cfg_feature! {
|
||||
#![feature = "tcp"]
|
||||
|
||||
mod tcp;
|
||||
}
|
||||
#[cfg(feature = "tcp")]
|
||||
mod tcp;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user