mirror of
https://github.com/msfjarvis/clipboard-substitutor
synced 2025-08-14 22:27:03 +05:30
refactor: remove unnecessary clones and borrows
This commit is contained in:
parent
0385f033b2
commit
952afdcec3
1 changed files with 2 additions and 2 deletions
|
@ -59,12 +59,12 @@ fn loop_clipboard<'a>(config: Replacements<'a>) {
|
||||||
if let Some(subst) = config
|
if let Some(subst) = config
|
||||||
.substitutors
|
.substitutors
|
||||||
.iter()
|
.iter()
|
||||||
.find(|subst| subst.matcher.clone().check_match(&contents))
|
.find(|subst| subst.matcher.check_match(contents))
|
||||||
{
|
{
|
||||||
if subst.name.is_empty().not() {
|
if subst.name.is_empty().not() {
|
||||||
debug!("{}: matched on {}...", &subst.name, truncate(&contents, 40));
|
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()) {
|
if let Err(e) = clipboard.set_contents(result.to_owned()) {
|
||||||
error!("{e}");
|
error!("{e}");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue