Skip to content

Commit 4b66815

Browse files
committed
Closes #1219 false positive for explicit_counter_loop
1 parent ebb88a4 commit 4b66815

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/ui/for_loop.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,3 +571,19 @@ mod issue_2496 {
571571
unimplemented!()
572572
}
573573
}
574+
575+
mod issue_1219 {
576+
// potential false positive for explicit_counter_loop
577+
pub fn test() {
578+
let thing = 5;
579+
let text = "banana";
580+
let mut count = 0;
581+
for ch in text.chars() {
582+
if ch == 'a' {
583+
continue;
584+
}
585+
count += 1
586+
}
587+
println!("{}", count);
588+
}
589+
}

0 commit comments

Comments
 (0)