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")))]
|
#[cfg(all(feature = "client", any(feature = "http1", feature = "http2")))]
|
||||||
pub(crate) use self::lazy::{lazy, Started as Lazy};
|
pub(crate) use self::lazy::{lazy, Started as Lazy};
|
||||||
#[cfg(any(
|
#[cfg(any(feature = "http1", feature = "http2", feature = "runtime"))]
|
||||||
feature = "client",
|
|
||||||
feature = "http1",
|
|
||||||
feature = "http2",
|
|
||||||
feature = "runtime"
|
|
||||||
))]
|
|
||||||
pub(crate) use self::never::Never;
|
pub(crate) use self::never::Never;
|
||||||
pub(crate) use self::task::Poll;
|
pub(crate) use self::task::Poll;
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ cfg_proto! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cfg_feature! {
|
cfg_feature! {
|
||||||
#![all(feature = "client")]
|
#![feature = "client"]
|
||||||
|
|
||||||
pub mod client;
|
pub mod client;
|
||||||
#[cfg(any(feature = "http1", feature = "http2"))]
|
#[cfg(any(feature = "http1", feature = "http2"))]
|
||||||
@@ -102,7 +102,7 @@ cfg_feature! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cfg_feature! {
|
cfg_feature! {
|
||||||
#![all(feature = "server")]
|
#![feature = "server"]
|
||||||
|
|
||||||
pub mod server;
|
pub mod server;
|
||||||
#[cfg(any(feature = "http1", feature = "http2"))]
|
#[cfg(any(feature = "http1", feature = "http2"))]
|
||||||
|
|||||||
@@ -157,10 +157,6 @@ cfg_feature! {
|
|||||||
pub mod conn;
|
pub mod conn;
|
||||||
mod server;
|
mod server;
|
||||||
mod shutdown;
|
mod shutdown;
|
||||||
|
#[cfg(feature = "tcp")]
|
||||||
cfg_feature! {
|
mod tcp;
|
||||||
#![feature = "tcp"]
|
|
||||||
|
|
||||||
mod tcp;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -353,8 +353,7 @@ impl<I, E> Builder<I, E> {
|
|||||||
/// # Cargo Feature
|
/// # Cargo Feature
|
||||||
///
|
///
|
||||||
/// Requires the `runtime` cargo feature to be enabled.
|
/// Requires the `runtime` cargo feature to be enabled.
|
||||||
#[cfg(feature = "runtime")]
|
#[cfg(all(feature = "runtime", feature = "http2"))]
|
||||||
#[cfg(feature = "http2")]
|
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
|
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
|
||||||
pub fn http2_keep_alive_interval(mut self, interval: impl Into<Option<Duration>>) -> Self {
|
pub fn http2_keep_alive_interval(mut self, interval: impl Into<Option<Duration>>) -> Self {
|
||||||
self.protocol.http2_keep_alive_interval(interval);
|
self.protocol.http2_keep_alive_interval(interval);
|
||||||
@@ -371,8 +370,7 @@ impl<I, E> Builder<I, E> {
|
|||||||
/// # Cargo Feature
|
/// # Cargo Feature
|
||||||
///
|
///
|
||||||
/// Requires the `runtime` cargo feature to be enabled.
|
/// Requires the `runtime` cargo feature to be enabled.
|
||||||
#[cfg(feature = "runtime")]
|
#[cfg(all(feature = "runtime", feature = "http2"))]
|
||||||
#[cfg(feature = "http2")]
|
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
|
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
|
||||||
pub fn http2_keep_alive_timeout(mut self, timeout: Duration) -> Self {
|
pub fn http2_keep_alive_timeout(mut self, timeout: Duration) -> Self {
|
||||||
self.protocol.http2_keep_alive_timeout(timeout);
|
self.protocol.http2_keep_alive_timeout(timeout);
|
||||||
|
|||||||
Reference in New Issue
Block a user