From af443f8f5730d4ec4d78ba14881dfdc289a3932e Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Mon, 17 Feb 2020 09:08:28 -0500 Subject: [PATCH] Prefer `.remove()` over `.get()` to avoid clone --- src/builtin/macros.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/builtin/macros.rs b/src/builtin/macros.rs index 1b8518e..bfeeeee 100644 --- a/src/builtin/macros.rs +++ b/src/builtin/macros.rs @@ -9,10 +9,10 @@ macro_rules! arg { }; }; ($args:ident, $idx:literal, $name:literal=$default:expr) => { - match $args.get(stringify!($idx)) { - Some(v) => v.clone(), - None => match $args.get($name) { - Some(v) => v.clone(), + match $args.remove(stringify!($idx)) { + Some(v) => v.eval(), + None => match $args.remove($name) { + Some(v) => v.eval(), None => $default, }, };