From 9ac6740b21b87eca327b4e3acad5a6b647b3636c Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 22 Jan 2021 19:23:44 +0000 Subject: chore: fix clippy warnings --- dhall/src/semantics/nze/nir.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'dhall/src/semantics/nze') 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, ()> { + pub fn remove_binder(&self) -> Option> { 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()), } } } -- cgit v1.2.3