summaryrefslogtreecommitdiff
path: root/dhall/src
diff options
context:
space:
mode:
authorNadrieril2020-05-30 11:39:07 +0100
committerNadrieril2020-05-30 13:57:06 +0100
commitec297fd75217348d81c7cee5f154d77aa7f0e42b (patch)
tree49064a427ff46a80143fa537bafda4706acb673f /dhall/src
parent4aab03c67869ff4ecc473794f62e35e4565a01d6 (diff)
Fix cache path resolution on wasm
Diffstat (limited to 'dhall/src')
-rw-r--r--dhall/src/semantics/resolve/cache.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/dhall/src/semantics/resolve/cache.rs b/dhall/src/semantics/resolve/cache.rs
index b725bf3..7fdd758 100644
--- a/dhall/src/semantics/resolve/cache.rs
+++ b/dhall/src/semantics/resolve/cache.rs
@@ -18,6 +18,7 @@ const ALTERNATE_ENV_VAR: &str = "HOME";
#[cfg(windows)]
const ALTERNATE_ENV_VAR: &str = "LOCALAPPDATA";
+#[cfg(any(unix, windows))]
fn alternate_env_var_cache_dir(
provider: impl Fn(&str) -> Result<String, VarError>,
) -> Option<PathBuf> {
@@ -26,6 +27,12 @@ fn alternate_env_var_cache_dir(
.map(|env_dir| env_dir.join(".cache").join("dhall"))
.ok()
}
+#[cfg(not(any(unix, windows)))]
+fn alternate_env_var_cache_dir(
+ _provider: impl Fn(&str) -> Result<String, VarError>,
+) -> Option<PathBuf> {
+ None
+}
fn env_var_cache_dir(
provider: impl Fn(&str) -> Result<String, VarError>,