diff --git a/src/lib.rs b/src/lib.rs index 7b08e2e..fcf152c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -184,14 +184,13 @@ impl<'a> FMBuilder<'a> { fn validate(&self) -> Result<(), Box> { let lines = self.ptn.lines().collect::>(); for i in 0..lines.len() { - if i < lines.len() - 1 { - if lines[i].trim() == WILDCARD && lines[i + 1].trim() == WILDCARD { - return Err(Box::::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::::from(format!( + "Can't have two consecutive wildcards lines at lines {} and {}.", + i + 1, + i + 2 + ))); } }