Fix WHILE_LET_LOOP doc
This commit is contained in:
parent
a53614a910
commit
49a501856d
@ -188,22 +188,22 @@
|
|||||||
/// The `while let` loop is usually shorter and more
|
/// The `while let` loop is usually shorter and more
|
||||||
/// readable.
|
/// readable.
|
||||||
///
|
///
|
||||||
/// ### Known problems
|
|
||||||
/// Sometimes the wrong binding is displayed ([#383](https://github.com/rust-lang/rust-clippy/issues/383)).
|
|
||||||
///
|
|
||||||
/// ### Example
|
/// ### Example
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # let y = Some(1);
|
/// let y = Some(1);
|
||||||
/// loop {
|
/// loop {
|
||||||
/// let x = match y {
|
/// let x = match y {
|
||||||
/// Some(x) => x,
|
/// Some(x) => x,
|
||||||
/// None => break,
|
/// None => break,
|
||||||
/// };
|
/// };
|
||||||
/// // .. do something with x
|
/// // ..
|
||||||
/// }
|
/// }
|
||||||
/// // is easier written as
|
/// ```
|
||||||
|
/// Use instead:
|
||||||
|
/// ```rust,no_run
|
||||||
|
/// let y = Some(1);
|
||||||
/// while let Some(x) = y {
|
/// while let Some(x) = y {
|
||||||
/// // .. do something with x
|
/// // ..
|
||||||
/// };
|
/// };
|
||||||
/// ```
|
/// ```
|
||||||
#[clippy::version = "pre 1.29.0"]
|
#[clippy::version = "pre 1.29.0"]
|
||||||
|
Loading…
Reference in New Issue
Block a user