Skip to content

Commit

Permalink
add native-client feature
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcAntoine-Arnaud committed Feb 24, 2022
1 parent 726748d commit c1ab9e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ wasm-client = [
"getrandom/js",
"web-sys",
]
native-client = ["http-client/native_client", "default-client"]
default-client = []
middleware-logger = []
# requires web-sys for TextDecoder on wasm
Expand Down
4 changes: 4 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ cfg_if! {
use http_client::h1::H1Client as DefaultClient;
} else if #[cfg(feature = "hyper-client")] {
use http_client::hyper::HyperClient as DefaultClient;
} else if #[cfg(all(feature = "native-client", target_arch = "wasm32"))] {
use http_client::wasm::WasmClient as DefaultClient;
} else if #[cfg(all(feature = "native-client", not(target_arch = "wasm32")))] {
use http_client::isahc::IsahcClient as DefaultClient;
}
}
cfg_if! {
Expand Down

0 comments on commit c1ab9e3

Please sign in to comment.