-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client): Make
client
an optional feature
cc #2223 BREAKING CHANGE: The HTTP client of hyper is now an optional feature. To enable the client, add `features = ["client"]` to the dependency in your `Cargo.toml`.
- Loading branch information
1 parent
eb092a7
commit 4e55583
Showing
19 changed files
with
238 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,50 @@ | ||
macro_rules! cfg_any_http { | ||
($($item:item)*) => { | ||
macro_rules! cfg_feature { | ||
( | ||
#![$meta:meta] | ||
$($item:item)* | ||
) => { | ||
$( | ||
#[cfg(any( | ||
feature = "http1", | ||
feature = "http2", | ||
))] | ||
#[cfg_attr(docsrs, doc(cfg(any( | ||
feature = "http1", | ||
feature = "http2", | ||
))))] | ||
#[cfg($meta)] | ||
#[cfg_attr(docsrs, doc(cfg($meta)))] | ||
$item | ||
)* | ||
} | ||
} | ||
|
||
macro_rules! cfg_any_http { | ||
($($item:item)*) => { | ||
cfg_feature! { | ||
#![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 | ||
)* | ||
cfg_feature! { | ||
#![feature = "http1"] | ||
$($item)* | ||
} | ||
} | ||
} | ||
|
||
macro_rules! cfg_http2 { | ||
($($item:item)*) => { | ||
$( | ||
#[cfg(feature = "http2")] | ||
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))] | ||
$item | ||
)* | ||
cfg_feature! { | ||
#![feature = "http2"] | ||
$($item)* | ||
} | ||
} | ||
} | ||
|
||
macro_rules! cfg_client { | ||
($($item:item)*) => { | ||
cfg_feature! { | ||
#![feature = "client"] | ||
$($item)* | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.