1 #![warn(clippy::explicit_counter_loop)]
4 let mut vec = vec![1, 2, 3, 4];
19 // should not trigger the lint because variable is used after the loop #473
20 let vec = vec![1, 2, 3];
25 println!("index: {}", index);
27 // should not trigger the lint because the count is conditional #1219
30 for ch in text.chars() {
35 println!("{}", count);
38 // should not trigger the lint because the count is conditional
41 for ch in text.chars() {
45 println!("{}", count);
48 // should trigger the lint because the count is not conditional
51 for ch in text.chars() {
56 println!("{}", count);
59 // should trigger the lint because the count is not conditional
62 for ch in text.chars() {
67 println!("{}", count);
70 // should not trigger the lint because the count is incremented multiple times
73 for ch in text.chars() {
78 println!("{}", count);
85 // should not trigger the lint because the count is incremented multiple times
87 let erasures = vec![];
89 while erasures.contains(&(i + skips)) {
92 println!("{}", skips);
95 // should not trigger the lint because the count is incremented multiple times
103 println!("{}", skips);
106 // should not trigger the lint because the count is incremented multiple times
112 println!("{}", skips);