summaryrefslogtreecommitdiff
path: root/dhall/src/semantics
diff options
context:
space:
mode:
authorNadrieril2020-10-12 16:02:50 +0100
committerGitHub2020-10-12 16:02:50 +0100
commit64cfd332f4617cfd760d5cae63f3bb6cd725595f (patch)
tree6793f5a549d1f56b36cd2c719a07626e4db5672c /dhall/src/semantics
parent3f40ab4625b8ea3e0eeb894d95557f5790c02776 (diff)
parent11ff1d502d5706b92e09a4051f7ffc708859409c (diff)
Merge pull request #178 from basile-henry/optional-reqwest
Make reqwest an optional dependency
Diffstat (limited to 'dhall/src/semantics')
-rw-r--r--dhall/src/semantics/resolve/resolve.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/dhall/src/semantics/resolve/resolve.rs b/dhall/src/semantics/resolve/resolve.rs
index 036e9a0..2b401dc 100644
--- a/dhall/src/semantics/resolve/resolve.rs
+++ b/dhall/src/semantics/resolve/resolve.rs
@@ -197,10 +197,14 @@ fn mkexpr(kind: UnspannedExpr) -> Expr {
}
// TODO: error handling
-#[cfg(not(target_arch = "wasm32"))]
+#[cfg(all(not(target_arch = "wasm32"), feature = "reqwest"))]
pub(crate) fn download_http_text(url: Url) -> Result<String, Error> {
Ok(reqwest::blocking::get(url).unwrap().text().unwrap())
}
+#[cfg(all(not(target_arch = "wasm32"), not(feature = "reqwest")))]
+pub(crate) fn download_http_text(_url: Url) -> Result<String, Error> {
+ panic!("Remote imports are disabled in this build of dhall-rust")
+}
#[cfg(target_arch = "wasm32")]
pub(crate) fn download_http_text(_url: Url) -> Result<String, Error> {
panic!("Remote imports are not supported on wasm yet")