From 88c65127665904899ac85cc1a952f562e600675d Mon Sep 17 00:00:00 2001 From: Laurence Tratt Date: Fri, 10 Nov 2023 15:52:36 +0000 Subject: [PATCH] Clippy fixes --- src/lib.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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 + ))); } }