]> git.lizzy.rs Git - rust.git/blobdiff - clippy_utils/src/sugg.rs
Fix test comment for `while_let_on_iterator`
[rust.git] / clippy_utils / src / sugg.rs
index 0633a19391f8633d281567ac0986bf088d25cb8d..0c95066175771d6c87c20db69dfece1fbd65072a 100644 (file)
@@ -289,7 +289,7 @@ fn has_enclosing_paren(sugg: impl AsRef<str>) -> bool {
     let mut chars = sugg.as_ref().chars();
     if let Some('(') = chars.next() {
         let mut depth = 1;
-        while let Some(c) = chars.next() {
+        for c in &mut chars {
             if c == '(' {
                 depth += 1;
             } else if c == ')' {