Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit dc7f227

Browse files
committed
For example should be used instead while in WHILE_LET_ON_ITERATOR
`For` example should be used instead `while` in WHILE_LET_ON_ITERATOR For example should be used instead while in WHILE_LET_ON_ITERATOR Revert some changes Fix cargo dev fmt
1 parent 71f2de9 commit dc7f227

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

clippy_lints/src/loops/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,14 @@ declare_clippy_lint! {
346346
///
347347
/// ### Example
348348
/// ```ignore
349-
/// while let Some(val) = iter() {
349+
/// while let Some(val) = iter.next() {
350+
/// ..
351+
/// }
352+
/// ```
353+
///
354+
/// Use instead:
355+
/// ```ignore
356+
/// for val in &mut iter {
350357
/// ..
351358
/// }
352359
/// ```

0 commit comments

Comments
 (0)