From af77f1703ef37d82132f8892368629aad2486bd8 Mon Sep 17 00:00:00 2001 From: Ophir LOJKINE Date: Mon, 14 Mar 2022 15:58:42 +0100 Subject: [PATCH] remove unnecessary clone --- src/function/builtin.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/function/builtin.rs b/src/function/builtin.rs index 3e44c17..04b50b7 100644 --- a/src/function/builtin.rs +++ b/src/function/builtin.rs @@ -122,11 +122,11 @@ pub fn builtin_function(identifier: &str) -> Option { } })), "if" => Some(Function::new(|argument| { - let arguments = &argument.as_fixed_len_tuple(3)?; + let mut arguments = argument.as_fixed_len_tuple(3)?; Ok(if arguments[0].as_boolean()? { - arguments[1].clone() + arguments.swap_remove(1) } else { - arguments[2].clone() + arguments.swap_remove(2) }) })), "len" => Some(Function::new(|argument| {