all: update trivial formatting macros to use implicit capture

This commit is contained in:
Harsh Shandilya 2022-01-23 14:40:42 +05:30
parent 84afa4573f
commit 0a0919faf6
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80
2 changed files with 3 additions and 3 deletions

View file

@ -75,8 +75,8 @@ impl Act for Action<'_> {
fn apply_action(self, input: &str) -> String {
return match self {
Action::Replace { from, to } => input.replace(from, to),
Action::Prefix { prefix } => format!("{}{}", prefix, input),
Action::Suffix { suffix } => format!("{}{}", input, suffix),
Action::Prefix { prefix } => format!("{prefix}{input}"),
Action::Suffix { suffix } => format!("{input}{suffix}"),
Action::Set { content } => content.to_owned(),
};
}

View file

@ -32,7 +32,7 @@ fn main() -> Result<()> {
}
let result = subst.action.clone().apply_action(contents.deref());
if let Err(e) = clipboard.set_contents(result.to_owned()) {
error!("{}", e);
error!("{e}");
}
};
while let Ok(new_contents) = get_clipboard_contents(&mut clipboard) {