chore(config): fix clippy lints

This commit is contained in:
Harsh Shandilya 2022-07-14 02:10:16 +05:30
parent 2ba4cd54fb
commit 5d1d59954d
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80

View file

@ -69,25 +69,21 @@ pub trait Act {
impl Replacements<'_> {
pub fn validate(&self) -> Result<()> {
for subst in self.substitutors.iter() {
for subst in &self.substitutors {
match &subst.matcher {
MatcherType::Single(matcher) => match matcher {
Matcher::Regex { pattern } => {
MatcherType::Single(matcher) => {
if let Matcher::Regex { pattern } = matcher {
if let Err(e) = Regex::from_str(pattern) {
bail!(e);
}
}
_ => {}
},
}
MatcherType::Multiple(matchers) => {
for matcher in matchers.iter() {
match matcher {
Matcher::Regex { pattern } => {
if let Err(e) = Regex::from_str(pattern) {
bail!(e);
}
if let Matcher::Regex { pattern } = matcher {
if let Err(e) = Regex::from_str(pattern) {
bail!(e);
}
_ => {}
}
}
}