clippy_lint: Fix doc on 'option_if_let_else'
- a typo in `expresion` - a useless double space - Some back-tick quotes for 'if let'
This commit is contained in:
parent
195cc9be94
commit
732d370404
@ -13,14 +13,14 @@ use rustc_session::{declare_lint_pass, declare_tool_lint};
|
||||
|
||||
declare_clippy_lint! {
|
||||
/// **What it does:**
|
||||
/// Lints usage of `if let Some(v) = ... { y } else { x }` which is more
|
||||
/// 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…
x
Reference in New Issue
Block a user