Skip to content

Commit

Permalink
Fix WHILE_LET_LOOP doc
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-semenyuk committed Sep 11, 2024
1 parent a53614a commit 49a5018
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 49a5018

Please sign in to comment.