From 4e2bb03bcf6355d49216c6886bf03e5aeaad16cc Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 30 Jan 2020 22:01:54 +0000 Subject: Eval Thunk by move --- dhall/src/semantics/nze/value.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'dhall') diff --git a/dhall/src/semantics/nze/value.rs b/dhall/src/semantics/nze/value.rs index 945ee6e..724e3e8 100644 --- a/dhall/src/semantics/nze/value.rs +++ b/dhall/src/semantics/nze/value.rs @@ -502,12 +502,11 @@ impl Thunk { ) -> Self { Thunk::PartialExpr { env, expr, ty } } - // TODO: take by value - pub fn eval(&self) -> ValueKind { + pub fn eval(self) -> ValueKind { match self { - Thunk::Thunk { env, body } => normalize_tyexpr_whnf(body, env), + Thunk::Thunk { env, body } => normalize_tyexpr_whnf(&body, &env), Thunk::PartialExpr { env, expr, ty } => { - normalize_one_layer(expr.clone(), ty, env) + normalize_one_layer(expr, &ty, &env) } } } -- cgit v1.2.3