From 4c840270cf69f9580b18c43736bd247cab74e896 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 14 Apr 2019 23:39:19 +0200 Subject: clippy --- dhall/src/typecheck.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'dhall/src/typecheck.rs') diff --git a/dhall/src/typecheck.rs b/dhall/src/typecheck.rs index 8bc1cdd..b8f2d86 100644 --- a/dhall/src/typecheck.rs +++ b/dhall/src/typecheck.rs @@ -32,11 +32,10 @@ impl<'a> Resolved<'a> { } impl<'a> Typed<'a> { fn get_type_move(self) -> Result, TypeError> { - self.1.ok_or(TypeError::new( - &Context::new(), - self.0, - TypeMessage::Untyped, - )) + let (expr, ty) = (self.0, self.1); + ty.ok_or_else(|| { + TypeError::new(&Context::new(), expr, TypeMessage::Untyped) + }) } } impl<'a> Normalized<'a> { @@ -128,10 +127,10 @@ fn match_vars(vl: &V