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 Nov 16, 2020
1 parent 8f00394 commit 930af77
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 @@ -23,6 +23,7 @@ default = ["curl-client", "middleware-logger", "encoding"]
curl-client = ["http-client/curl_client", "once_cell", "default-client"]
h1-client = ["http-client/h1_client", "default-client"]
hyper-client = ["http-client/hyper_client", "once_cell", "default-client", "async-std/tokio02"]
native-client = ["http-client/native_client", "default-client"]
wasm-client = ["http-client/wasm_client", "default-client"]
default-client = []
middleware-logger = []
Expand Down
4 changes: 4 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,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 930af77

Please sign in to comment.