Skip to content

Commit cbd2185

Browse files
committed
Revert default-client changes
This was changed in the previous commit when it didn't need to be 3a56e67
1 parent 3a56e67 commit cbd2185

File tree

3 files changed

+7
-47
lines changed

3 files changed

+7
-47
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,4 @@ jobs:
100100
- name: Check all feature combinations works properly
101101
# * `--feature-powerset` - run for the feature powerset of the package
102102
# * `--no-dev-deps` - build without dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
103-
run: cargo hack check --feature-powerset --no-dev-deps
103+
run: cargo hack check --feature-powerset --no-dev-deps --skip=default-client,wasm-client

src/client.rs

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use cfg_if::cfg_if;
1010
cfg_if! {
1111
if #[cfg(feature = "curl-client")] {
1212
use http_client::isahc::IsahcClient as DefaultClient;
13-
} else if #[cfg(all(feature = "wasm-client", target_arch = "wasm32"))] {
13+
} else if #[cfg(feature = "wasm-client")] {
1414
use http_client::wasm::WasmClient as DefaultClient;
1515
} else if #[cfg(feature = "h1-client")] {
1616
use http_client::h1::H1Client as DefaultClient;
@@ -76,15 +76,7 @@ impl fmt::Debug for Client {
7676
}
7777
}
7878

79-
#[cfg(all(
80-
feature = "default-client",
81-
any(
82-
feature = "curl-client",
83-
all(feature = "wasm-client", target_arch = "wasm32"),
84-
feature = "h1-client",
85-
feature = "hyper-client"
86-
)
87-
))]
79+
#[cfg(feature = "default-client")]
8880
impl Default for Client {
8981
fn default() -> Self {
9082
Self::new()
@@ -105,30 +97,14 @@ impl Client {
10597
/// let res = client.send(req).await?;
10698
/// # Ok(()) }
10799
/// ```
108-
#[cfg(all(
109-
feature = "default-client",
110-
any(
111-
feature = "curl-client",
112-
all(feature = "wasm-client", target_arch = "wasm32"),
113-
feature = "h1-client",
114-
feature = "hyper-client"
115-
)
116-
))]
100+
#[cfg(feature = "default-client")]
117101
pub fn new() -> Self {
118102
Self::with_http_client(DefaultClient::new())
119103
}
120104

121105
pub(crate) fn new_shared_or_panic() -> Self {
122106
cfg_if! {
123-
if #[cfg(all(
124-
feature = "default-client",
125-
any(
126-
feature = "curl-client",
127-
all(feature = "wasm-client", target_arch = "wasm32"),
128-
feature = "h1-client",
129-
feature = "hyper-client"
130-
)
131-
))] {
107+
if #[cfg(feature = "default-client")] {
132108
Self::new_shared()
133109
} else {
134110
panic!("default client not configured")
@@ -164,15 +140,7 @@ impl Client {
164140
client
165141
}
166142

167-
#[cfg(all(
168-
feature = "default-client",
169-
any(
170-
feature = "curl-client",
171-
all(feature = "wasm-client", target_arch = "wasm32"),
172-
feature = "h1-client",
173-
feature = "hyper-client"
174-
)
175-
))]
143+
#[cfg(feature = "default-client")]
176144
pub(crate) fn new_shared() -> Self {
177145
cfg_if! {
178146
if #[cfg(any(feature = "curl-client", feature = "hyper-client"))] {

src/lib.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,7 @@ pub use request_builder::RequestBuilder;
9696
pub use response::{DecodeError, Response};
9797

9898
cfg_if::cfg_if! {
99-
if #[cfg(all(
100-
feature = "default-client",
101-
any(
102-
feature = "curl-client",
103-
all(feature = "wasm-client", target_arch = "wasm32"),
104-
feature = "h1-client",
105-
feature = "hyper-client"
106-
)
107-
))] {
99+
if #[cfg(feature = "default-client")] {
108100
mod one_off;
109101
pub use one_off::{connect, delete, get, head, options, patch, post, put, trace};
110102

0 commit comments

Comments
 (0)