http-rs / surf

Fast and friendly HTTP client framework for async Rust
https://docs.rs/surf
Apache License 2.0
1.46k stars 119 forks source link

Add native-client feature #265

Open MarcAntoine-Arnaud opened 3 years ago

Fishrock123 commented 3 years ago

Why?

MarcAntoine-Arnaud commented 3 years ago

Why?

To select backend with the native-client for every target, and don't need to play with features for targets... Without that I need to wrote:

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
surf = { version = "2.1.0", default-features = false, features = ["curl-client"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
surf = { version = "2.1.0", default-features = false, features = ["wasm-client"] }

With that we will be able to wrote:

surf = { version = "2.1.0", default-features = false, features = ["native-client"] }