Skip to content

Commit bd8f289

Browse files
author
BO41
committed
Add example to needless_range_loop
1 parent 647cc40 commit bd8f289

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clippy_lints/src/loops.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ declare_clippy_lint! {
6666
/// println!("{}", vec[i]);
6767
/// }
6868
/// ```
69+
/// Could be written as:
70+
/// ```ignore
71+
/// for i in vec {
72+
/// println!("{}", i);
73+
/// }
74+
/// ```
6975
pub NEEDLESS_RANGE_LOOP,
7076
style,
7177
"for-looping over a range of indices where an iterator over items would do"

0 commit comments

Comments
 (0)