Skip to content

Commit bc0bf06

Browse files
committed
Auto merge of #9017 - alex-semenyuk:while_let_on_iterator_doc_fix, r=giraffate
Example for `WHILE_LET_ON_ITERATOR` changelog: none example for `WHILE_LET_ON_ITERATOR`, using `for` instead of `while let`
2 parents 93c6f9e + dc7f227 commit bc0bf06

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)