Skip to content

Commit

Permalink
Clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ltratt committed Nov 10, 2023
1 parent f9e90a9 commit 88c6512
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,13 @@ impl<'a> FMBuilder<'a> {
fn validate(&self) -> Result<(), Box<dyn Error>> {
let lines = self.ptn.lines().collect::<Vec<_>>();
for i in 0..lines.len() {
if i < lines.len() - 1 {
if lines[i].trim() == WILDCARD && lines[i + 1].trim() == WILDCARD {
return Err(Box::<dyn Error>::from(format!(
"Can't have two consecutive wildcards lines at lines {} and {}.",
i + 1,
i + 2
)));
}
if i < lines.len() - 1 && lines[i].trim() == WILDCARD && lines[i + 1].trim() == WILDCARD
{
return Err(Box::<dyn Error>::from(format!(
"Can't have two consecutive wildcards lines at lines {} and {}.",
i + 1,
i + 2
)));
}
}

Expand Down

0 comments on commit 88c6512

Please sign in to comment.