remove unnecessary clone

This commit is contained in:
Ophir LOJKINE 2022-03-14 15:58:42 +01:00
parent 7522df14b7
commit af77f1703e

View File

@ -122,11 +122,11 @@ pub fn builtin_function(identifier: &str) -> Option<Function> {
} }
})), })),
"if" => Some(Function::new(|argument| { "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()? { Ok(if arguments[0].as_boolean()? {
arguments[1].clone() arguments.swap_remove(1)
} else { } else {
arguments[2].clone() arguments.swap_remove(2)
}) })
})), })),
"len" => Some(Function::new(|argument| { "len" => Some(Function::new(|argument| {