diff options
| author | bors <bors@rust-lang.org> | 2024-09-11 10:03:50 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-09-11 10:03:50 +0000 |
| commit | 78bdd4508d1738e9e4f508a116af9ccf33edbdd4 (patch) | |
| tree | 83971230d2f4db27344d1ff8af1c3f943a12c717 | |
| parent | a53614a910310130ac75ce15a73a8c4dbd795826 (diff) | |
| parent | 49a501856dd3dc390de7a7ef01ac9c48c13f209c (diff) | |
| download | rust-78bdd4508d1738e9e4f508a116af9ccf33edbdd4.tar.gz rust-78bdd4508d1738e9e4f508a116af9ccf33edbdd4.zip | |
Auto merge of #13379 - alex-semenyuk:while_let_loop_fix_document, r=dswij
Fix doc for `while_let_loop` Fix doc for `while_let_loop` changelog: none
| -rw-r--r-- | clippy_lints/src/loops/mod.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/clippy_lints/src/loops/mod.rs b/clippy_lints/src/loops/mod.rs index 92ccc0cc0a1..5155fd76b25 100644 --- a/clippy_lints/src/loops/mod.rs +++ b/clippy_lints/src/loops/mod.rs @@ -188,22 +188,22 @@ declare_clippy_lint! { /// The `while let` loop is usually shorter and more /// readable. /// - /// ### Known problems - /// Sometimes the wrong binding is displayed ([#383](https://github.com/rust-lang/rust-clippy/issues/383)). - /// /// ### Example /// ```rust,no_run - /// # let y = Some(1); + /// let y = Some(1); /// loop { /// let x = match y { /// Some(x) => x, /// None => break, /// }; - /// // .. do something with x + /// // .. /// } - /// // is easier written as + /// ``` + /// Use instead: + /// ```rust,no_run + /// let y = Some(1); /// while let Some(x) = y { - /// // .. do something with x + /// // .. /// }; /// ``` #[clippy::version = "pre 1.29.0"] |
