From 11ff1d502d5706b92e09a4051f7ffc708859409c Mon Sep 17 00:00:00 2001 From: Basile Henry Date: Sat, 10 Oct 2020 12:36:51 +0200 Subject: Make reqwest an optional dependency This adds a feature to the Cargo.toml to be able to control if dhall depends on reqwest. This makes it possible to build dhall-rust for any arch (not just wasm32) without depending on reqwest. To disable reqwest as a dependency, we can now use `default-features = false` when adding the dhall dependency. Closes #169 --- dhall/Cargo.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'dhall/Cargo.toml') diff --git a/dhall/Cargo.toml b/dhall/Cargo.toml index 6c2c630..72fc13c 100644 --- a/dhall/Cargo.toml +++ b/dhall/Cargo.toml @@ -11,6 +11,9 @@ edition = "2018" build = "build.rs" include = ["src/**/*", "README.md", "build.rs"] +[features] +default = [ "reqwest" ] + [[test]] name = "spec" harness = false @@ -33,7 +36,7 @@ url = "2.1" # Reqwest needs proper async support to work on wasm. So no remote imports on # wasm for now. [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -reqwest = { version = "0.10", features = ["blocking"] } +reqwest = { version = "0.10", features = ["blocking"], optional = true } [dev-dependencies] anyhow = "1.0.28" -- cgit v1.2.3