feat(http1): Make HTTP/1 support an optional feature
cc #2251 BREAKING CHANGE: This puts all HTTP/1 methods and support behind an `http1` cargo feature, which will not be enabled by default. To use HTTP/1, add `features = ["http1"]` to the hyper dependency in your `Cargo.toml`.
This commit is contained in:
34
src/cfg.rs
34
src/cfg.rs
@@ -1,9 +1,37 @@
|
||||
macro_rules! cfg_http2 {
|
||||
macro_rules! cfg_any_http {
|
||||
($($item:item)*) => {
|
||||
$(
|
||||
#[cfg(feature = "http2")]
|
||||
//#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
|
||||
#[cfg(any(
|
||||
feature = "http1",
|
||||
feature = "http2",
|
||||
))]
|
||||
#[cfg_attr(docsrs, doc(cfg(any(
|
||||
feature = "http1",
|
||||
feature = "http2",
|
||||
))))]
|
||||
$item
|
||||
)*
|
||||
}
|
||||
}
|
||||
|
||||
cfg_any_http! {
|
||||
macro_rules! cfg_http1 {
|
||||
($($item:item)*) => {
|
||||
$(
|
||||
#[cfg(feature = "http1")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "http1")))]
|
||||
$item
|
||||
)*
|
||||
}
|
||||
}
|
||||
|
||||
macro_rules! cfg_http2 {
|
||||
($($item:item)*) => {
|
||||
$(
|
||||
#[cfg(feature = "http2")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
|
||||
$item
|
||||
)*
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user