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`
This commit is contained in:
bors 2022-06-22 00:01:49 +00:00
commit bc0bf06718

View File

@ -346,7 +346,14 @@ declare_clippy_lint! {
///
/// ### Example
/// ```ignore
/// while let Some(val) = iter() {
/// while let Some(val) = iter.next() {
/// ..
/// }
/// ```
///
/// Use instead:
/// ```ignore
/// for val in &mut iter {
/// ..
/// }
/// ```