mirror of
https://github.com/msfjarvis/clipboard-substitutor
synced 2025-08-15 05:27:01 +05:30
chore: fix Clippy lints
This commit is contained in:
parent
6d75c14a93
commit
ebf0a076fd
2 changed files with 5 additions and 5 deletions
|
@ -66,7 +66,7 @@ impl Replacements {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MatcherType::Multiple(matchers) => {
|
MatcherType::Multiple(matchers) => {
|
||||||
for matcher in matchers.iter() {
|
for matcher in matchers {
|
||||||
if let Matcher::Regex { pattern } = matcher {
|
if let Matcher::Regex { pattern } = matcher {
|
||||||
if let Err(e) = Regex::from_str(pattern) {
|
if let Err(e) = Regex::from_str(pattern) {
|
||||||
bail!(e);
|
bail!(e);
|
||||||
|
@ -115,8 +115,8 @@ impl Act for Action {
|
||||||
trace!(?self, ?input, "Applying action");
|
trace!(?self, ?input, "Applying action");
|
||||||
match self {
|
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.clone(),
|
Action::Set { content } => content.clone(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ matcher = { regex = { pattern = "^https://(?P<host>(?:mobile.)?twitter.com)/.*/s
|
||||||
action = { replace = { from = "twitter.com", to = "vxtwitter.com" } }
|
action = { replace = { from = "twitter.com", to = "vxtwitter.com" } }
|
||||||
"#;
|
"#;
|
||||||
let config: Replacements = toml::from_str(config)?;
|
let config: Replacements = toml::from_str(config)?;
|
||||||
assert!(matches!(config.validate(), Ok(_)));
|
assert!(config.validate().is_ok());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[assay]
|
#[assay]
|
||||||
|
@ -100,5 +100,5 @@ matcher = { regex = { pattern = "^https://(?P<>(?:mobile.)?twitter.com)/.*/statu
|
||||||
action = { replace = { from = "twitter.com", to = "vxtwitter.com" } }
|
action = { replace = { from = "twitter.com", to = "vxtwitter.com" } }
|
||||||
"#;
|
"#;
|
||||||
let config: Replacements = toml::from_str(config)?;
|
let config: Replacements = toml::from_str(config)?;
|
||||||
assert!(matches!(config.validate(), Err(_)));
|
assert!(config.validate().is_err());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue