Skip to content

Commit c1ab9e3

Browse files
add native-client feature
1 parent 726748d commit c1ab9e3

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
@@ -52,6 +52,7 @@ wasm-client = [
5252
"getrandom/js",
5353
"web-sys",
5454
]
55+
native-client = ["http-client/native_client", "default-client"]
5556
default-client = []
5657
middleware-logger = []
5758
# requires web-sys for TextDecoder on wasm

src/client.rs

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

0 commit comments

Comments
 (0)