From 54d5b293908cf73fadf398a6411ebb11d53c358d Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Thu, 15 Oct 2020 23:44:05 +0800 Subject: [PATCH] Remove clone. --- src/fn_call.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/fn_call.rs b/src/fn_call.rs index 317930e3..915985d4 100644 --- a/src/fn_call.rs +++ b/src/fn_call.rs @@ -886,20 +886,18 @@ impl Engine { )); } - let (fn_name, fn_curry) = fn_ptr.cast::().take_data(); - - let mut curry = fn_curry.clone(); + let (fn_name, mut fn_curry) = fn_ptr.cast::().take_data(); // Append the new curried arguments to the existing list. args_expr .iter() .skip(1) .try_for_each(|expr| -> Result<(), Box> { - curry.push(self.eval_expr(scope, mods, state, lib, this_ptr, expr, level)?); + fn_curry.push(self.eval_expr(scope, mods, state, lib, this_ptr, expr, level)?); Ok(()) })?; - return Ok(FnPtr::new_unchecked(fn_name, curry).into()); + return Ok(FnPtr::new_unchecked(fn_name, fn_curry).into()); } // Handle is_shared()