mirror of
https://github.com/msfjarvis/clipboard-substitutor
synced 2025-08-14 18:57:02 +05:30
chore(config): fix clippy lints
This commit is contained in:
parent
2ba4cd54fb
commit
5d1d59954d
1 changed files with 7 additions and 11 deletions
|
@ -69,25 +69,21 @@ pub trait Act {
|
||||||
|
|
||||||
impl Replacements<'_> {
|
impl Replacements<'_> {
|
||||||
pub fn validate(&self) -> Result<()> {
|
pub fn validate(&self) -> Result<()> {
|
||||||
for subst in self.substitutors.iter() {
|
for subst in &self.substitutors {
|
||||||
match &subst.matcher {
|
match &subst.matcher {
|
||||||
MatcherType::Single(matcher) => match matcher {
|
MatcherType::Single(matcher) => {
|
||||||
Matcher::Regex { pattern } => {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {}
|
}
|
||||||
},
|
|
||||||
MatcherType::Multiple(matchers) => {
|
MatcherType::Multiple(matchers) => {
|
||||||
for matcher in matchers.iter() {
|
for matcher in matchers.iter() {
|
||||||
match matcher {
|
if let Matcher::Regex { pattern } = matcher {
|
||||||
Matcher::Regex { pattern } => {
|
if let Err(e) = Regex::from_str(pattern) {
|
||||||
if let Err(e) = Regex::from_str(pattern) {
|
bail!(e);
|
||||||
bail!(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue