Skip to content

Commit

Permalink
Auto merge of #13379 - alex-semenyuk:while_let_loop_fix_document, r=d…
Browse files Browse the repository at this point in the history
…swij

Fix doc for `while_let_loop`

Fix doc for `while_let_loop`

changelog: none
  • Loading branch information
bors committed Sep 11, 2024
2 parents a53614a + 49a5018 commit 78bdd45
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions clippy_lints/src/loops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 78bdd45

Please sign in to comment.