Skip to content

Commit 930af77

Browse files
add native-client feature
1 parent 8f00394 commit 930af77

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ default = ["curl-client", "middleware-logger", "encoding"]
2323
curl-client = ["http-client/curl_client", "once_cell", "default-client"]
2424
h1-client = ["http-client/h1_client", "default-client"]
2525
hyper-client = ["http-client/hyper_client", "once_cell", "default-client", "async-std/tokio02"]
26+
native-client = ["http-client/native_client", "default-client"]
2627
wasm-client = ["http-client/wasm_client", "default-client"]
2728
default-client = []
2829
middleware-logger = []

src/client.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ cfg_if! {
1616
use http_client::h1::H1Client as DefaultClient;
1717
} else if #[cfg(feature = "hyper-client")] {
1818
use http_client::hyper::HyperClient as DefaultClient;
19+
} else if #[cfg(all(feature = "native-client", target_arch = "wasm32"))] {
20+
use http_client::wasm::WasmClient as DefaultClient;
21+
} else if #[cfg(all(feature = "native-client", not(target_arch = "wasm32")))] {
22+
use http_client::isahc::IsahcClient as DefaultClient;
1923
}
2024
}
2125
cfg_if! {

0 commit comments

Comments
 (0)