mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
Adjust lint description for better clarity
This commit is contained in:
parent
80f0f280df
commit
f7f60b82e8
1 changed files with 5 additions and 3 deletions
|
@ -11,10 +11,12 @@ use rustc_session::{declare_tool_lint, impl_lint_pass};
|
|||
|
||||
declare_clippy_lint! {
|
||||
/// ### What it does
|
||||
/// Checks for if-else that could be written to `bool::then`.
|
||||
/// Checks for if-else that could be written using either `bool::then` or `bool::then_some`.
|
||||
///
|
||||
/// ### Why is this bad?
|
||||
/// Looks a little redundant. Using `bool::then` helps it have less lines of code.
|
||||
/// Looks a little redundant. Using `bool::then` is more concise and incurs no loss of clarity.
|
||||
/// For simple calculations and known values, use `bool::then_some`, which is eagerly evaluated
|
||||
/// in comparison to `bool::then`.
|
||||
///
|
||||
/// ### Example
|
||||
/// ```rust
|
||||
|
@ -39,7 +41,7 @@ declare_clippy_lint! {
|
|||
#[clippy::version = "1.53.0"]
|
||||
pub IF_THEN_SOME_ELSE_NONE,
|
||||
restriction,
|
||||
"Finds if-else that could be written using `bool::then`"
|
||||
"Finds if-else that could be written using either `bool::then` or `bool::then_some`"
|
||||
}
|
||||
|
||||
pub struct IfThenSomeElseNone {
|
||||
|
|
Loading…
Reference in a new issue