Add example to needless_range_loop

This commit is contained in:
BO41 2019-06-02 15:28:32 +02:00
parent 647cc4026f
commit bd8f289247

View File

@ -66,6 +66,12 @@ declare_clippy_lint! {
/// println!("{}", vec[i]);
/// }
/// ```
/// Could be written as:
/// ```ignore
/// for i in vec {
/// println!("{}", i);
/// }
/// ```
pub NEEDLESS_RANGE_LOOP,
style,
"for-looping over a range of indices where an iterator over items would do"