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<'_> { 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);
}
} }
_ => {}
} }
} }
} }