From 952afdcec3de60f4654c728fd65c787be94c228b Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 17 Feb 2022 13:11:33 +0530 Subject: [PATCH] refactor: remove unnecessary clones and borrows --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index f6a00a9..987871c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -59,12 +59,12 @@ fn loop_clipboard<'a>(config: Replacements<'a>) { if let Some(subst) = config .substitutors .iter() - .find(|subst| subst.matcher.clone().check_match(&contents)) + .find(|subst| subst.matcher.check_match(contents)) { if subst.name.is_empty().not() { debug!("{}: matched on {}...", &subst.name, truncate(&contents, 40)); } - let result = subst.action.clone().apply_action(contents.deref()); + let result = subst.action.apply_action(contents); if let Err(e) = clipboard.set_contents(result.to_owned()) { error!("{e}"); }