mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Auto merge of #6146 - woshilapin:patch-1, r=flip1995
clippy_lint: Fix doc on 'option_if_let_else' changelog: none
This commit is contained in:
commit
cad10fa3b3
@ -16,11 +16,11 @@ declare_clippy_lint! {
|
||||
/// Lints usage of `if let Some(v) = ... { y } else { x }` which is more
|
||||
/// idiomatically done with `Option::map_or` (if the else bit is a pure
|
||||
/// expression) or `Option::map_or_else` (if the else bit is an impure
|
||||
/// expresion).
|
||||
/// expression).
|
||||
///
|
||||
/// **Why is this bad?**
|
||||
/// Using the dedicated functions of the Option type is clearer and
|
||||
/// more concise than an if let expression.
|
||||
/// more concise than an `if let` expression.
|
||||
///
|
||||
/// **Known problems:**
|
||||
/// This lint uses a deliberately conservative metric for checking
|
||||
|
Loading…
Reference in New Issue
Block a user