summaryrefslogtreecommitdiff
path: root/dhall/src/semantics
diff options
context:
space:
mode:
authorNadrieril2021-01-22 19:49:08 +0000
committerGitHub2021-01-22 19:49:08 +0000
commit1397a53da0a6aa6d75b687c275baa21d3b99ed64 (patch)
tree5f9cb0058ce1799df482b7b03b3375da3b28ae2d /dhall/src/semantics
parent11ff03a8113580244ced04a8b370ab6192b8e413 (diff)
parentb70f16f865967375e5d80ff5b8979179072c73b4 (diff)
Merge pull request #209 from Nadrieril/fix-ci
Diffstat (limited to 'dhall/src/semantics')
-rw-r--r--dhall/src/semantics/nze/nir.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/dhall/src/semantics/nze/nir.rs b/dhall/src/semantics/nze/nir.rs
index 8cf06c5..124ac05 100644
--- a/dhall/src/semantics/nze/nir.rs
+++ b/dhall/src/semantics/nze/nir.rs
@@ -344,17 +344,17 @@ impl<'cx> Closure<'cx> {
self.apply_var(NzVar::new(venv.size()))
.to_hir(venv.insert())
}
- /// If the closure variable is free in the closure, return Err. Otherwise, return the value
+ /// If the closure variable is free in the closure, return `None`. Otherwise, return the value
/// with that free variable remove.
- pub fn remove_binder(&self) -> Result<Nir<'cx>, ()> {
+ pub fn remove_binder(&self) -> Option<Nir<'cx>> {
match self {
Closure::Closure { .. } => {
let v = NzVar::fresh();
// TODO: handle case where variable is used in closure
// TODO: return information about where the variable is used
- Ok(self.apply_var(v))
+ Some(self.apply_var(v))
}
- Closure::ConstantClosure { body, .. } => Ok(body.clone()),
+ Closure::ConstantClosure { body, .. } => Some(body.clone()),
}
}
}