Skip to content

Commit

Permalink
Clean up dependencies (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Apr 22, 2020
1 parent 2fd9f75 commit 034440e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 38 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [nightly]
backend: [native-client, h1-client]

steps:
- uses: actions/checkout@master
Expand All @@ -44,7 +45,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: test
args: --all
args: --all --no-default-features --features '${{ matrix.backend }} middleware-logger encoding'

check_fmt_and_docs:
name: Checking fmt and docs
Expand Down
46 changes: 10 additions & 36 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ readme = "README.md"
edition = "2018"

[features]
# when the default feature set is updated, verify that the `--features` flags in
# `.github/workflows/ci.yaml` are updated accordingly
default = ["native-client", "middleware-logger", "encoding"]
h1-client = ["async-h1", "wasm-client"]
h1-client = ["wasm-client", "http-client/h1_client"]
native-client = ["curl-client", "wasm-client", "http-client/native_client"]
hyper-client = ["hyper", "hyper-tls", "native-tls", "runtime", "runtime-raw", "runtime-tokio" ]
curl-client = ["isahc"]
wasm-client = ["js-sys", "web-sys", "wasm-bindgen", "wasm-bindgen-futures"]
curl-client = ["http-client/curl_client"]
wasm-client = ["http-client/wasm_client"]
middleware-logger = []
encoding = ["encoding_rs"]
# requires web-sys for TextDecoder on wasm
encoding = ["encoding_rs", "web-sys"]

[dependencies]
futures = { version = "0.3.1", features = ["compat", "io-compat"] }
Expand All @@ -33,53 +35,25 @@ serde_urlencoded = "0.6.1"
url = "2.0.0"
http-client = "2.0.0"
async-std = { version = "1.4.0", default-features = false, features = ["std"] }

# h1-client
async-h1 = { version = "1.0.0", optional = true }
pin-project-lite = "0.1.1"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# encoding
encoding_rs = { version = "0.8.20", optional = true }

# isahc-client
isahc = { version = "0.8", optional = true, default-features = false, features = ["http2"] }

# hyper-client
hyper = { version = "0.13.2", optional = true, default-features = false }
hyper-tls = { version = "0.3.2", optional = true }
native-tls = { version = "0.2.2", optional = true }
runtime = { version = "0.3.0-alpha.8", optional = true }
runtime-raw = { version = "0.3.0-alpha.4", optional = true }
runtime-tokio = { version = "0.3.0-alpha.6", optional = true }

# wasm-client
[target.'cfg(target_arch = "wasm32")'.dependencies]
js-sys = { version = "0.3.25", optional = true }
wasm-bindgen = { version = "0.2.48", optional = true }
wasm-bindgen-futures = { version = "0.4.5", optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies.web-sys]
version = "0.3.25"
optional = true
features = [
"AbortSignal",
"Headers",
"ObserverCallback",
"ReferrerPolicy",
"Request",
"RequestCache",
"RequestCredentials",
"RequestInit",
"RequestMode",
"RequestRedirect",
"Response",
"TextDecoder",
"Window",
]

[dev-dependencies]
async-std = { version = "1.0", features = ["attributes"] }
femme = "1.1.0"
serde = { version = "1.0.97", features = ["derive"] }
mockito = "0.23.3"

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen = "0.2.48"
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
//! - __`native-client` (default):__ use `curl` on the server and `window.fetch` in the browser.
//! - __`middleware-logger` (default):__ enables logging requests and responses using a middleware.
//! - __`curl-client`:__ use `curl` (through `isahc`) as the HTTP backend.
//! - __`hyper-client`:__ use `hyper` as the HTTP backend.
//! - __`wasm-client`:__ use `window.fetch` as the HTTP backend.

#![forbid(rust_2018_idioms)]
Expand Down

0 comments on commit 034440e

Please sign in to comment.