mirror of
https://github.com/msfjarvis/clipboard-substitutor
synced 2025-08-14 18:57:02 +05:30
all: update trivial formatting macros to use implicit capture
This commit is contained in:
parent
84afa4573f
commit
0a0919faf6
2 changed files with 3 additions and 3 deletions
|
@ -75,8 +75,8 @@ impl Act for Action<'_> {
|
||||||
fn apply_action(self, input: &str) -> String {
|
fn apply_action(self, input: &str) -> String {
|
||||||
return match self {
|
return match self {
|
||||||
Action::Replace { from, to } => input.replace(from, to),
|
Action::Replace { from, to } => input.replace(from, to),
|
||||||
Action::Prefix { prefix } => format!("{}{}", prefix, input),
|
Action::Prefix { prefix } => format!("{prefix}{input}"),
|
||||||
Action::Suffix { suffix } => format!("{}{}", input, suffix),
|
Action::Suffix { suffix } => format!("{input}{suffix}"),
|
||||||
Action::Set { content } => content.to_owned(),
|
Action::Set { content } => content.to_owned(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ fn main() -> Result<()> {
|
||||||
}
|
}
|
||||||
let result = subst.action.clone().apply_action(contents.deref());
|
let result = subst.action.clone().apply_action(contents.deref());
|
||||||
if let Err(e) = clipboard.set_contents(result.to_owned()) {
|
if let Err(e) = clipboard.set_contents(result.to_owned()) {
|
||||||
error!("{}", e);
|
error!("{e}");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
while let Ok(new_contents) = get_clipboard_contents(&mut clipboard) {
|
while let Ok(new_contents) = get_clipboard_contents(&mut clipboard) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue