diff --git a/README.md b/README.md index 188e272dc4df..e59012c81651 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ name [new_without_default](https://github.com/Manishearth/rust-clippy/wiki#new_without_default) | warn | `fn new() -> Self` method without `Default` implementation [no_effect](https://github.com/Manishearth/rust-clippy/wiki#no_effect) | warn | statements with no effect [non_ascii_literal](https://github.com/Manishearth/rust-clippy/wiki#non_ascii_literal) | allow | using any literal non-ASCII chars in a string literal; suggests using the \\u escape instead -[nonminimal_bool](https://github.com/Manishearth/rust-clippy/wiki#nonminimal_bool) | warn | checks for boolean expressions that can be written more concisely +[nonminimal_bool](https://github.com/Manishearth/rust-clippy/wiki#nonminimal_bool) | allow | checks for boolean expressions that can be written more concisely [nonsensical_open_options](https://github.com/Manishearth/rust-clippy/wiki#nonsensical_open_options) | warn | nonsensical combination of options for opening a file [ok_expect](https://github.com/Manishearth/rust-clippy/wiki#ok_expect) | warn | using `ok().expect()`, which gives worse error messages than calling `expect` directly on the Result [option_map_unwrap_or](https://github.com/Manishearth/rust-clippy/wiki#option_map_unwrap_or) | warn | using `Option.map(f).unwrap_or(a)`, which is more succinctly expressed as `map_or(a, f)` diff --git a/src/booleans.rs b/src/booleans.rs index 35ea5fe44621..877a45a355ad 100644 --- a/src/booleans.rs +++ b/src/booleans.rs @@ -9,11 +9,11 @@ use utils::{span_lint_and_then, in_macro, snippet_opt, SpanlessEq}; /// /// **Why is this bad?** Readability of boolean expressions suffers from unnecesessary duplication /// -/// **Known problems:** Ignores short circuting behavior, bitwise and/or and xor. Ends up suggesting things like !(a == b) +/// **Known problems:** Ignores short circuting behavior of `||` and `&&`. Ignores `|`, `&` and `^`. /// -/// **Example:** `if a && true` should be `if a` +/// **Example:** `if a && true` should be `if a` and `!(a == b)` should be `a != b` declare_lint! { - pub NONMINIMAL_BOOL, Warn, + pub NONMINIMAL_BOOL, Allow, "checks for boolean expressions that can be written more concisely" } diff --git a/src/lib.rs b/src/lib.rs index 617d2e242660..2d12532fcfea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -235,6 +235,7 @@ pub fn plugin_registrar(reg: &mut Registry) { reg.register_lint_group("clippy_pedantic", vec![ array_indexing::INDEXING_SLICING, + booleans::NONMINIMAL_BOOL, enum_glob_use::ENUM_GLOB_USE, matches::SINGLE_MATCH_ELSE, methods::OPTION_UNWRAP_USED, @@ -268,7 +269,6 @@ pub fn plugin_registrar(reg: &mut Registry) { block_in_if_condition::BLOCK_IN_IF_CONDITION_EXPR, block_in_if_condition::BLOCK_IN_IF_CONDITION_STMT, booleans::LOGIC_BUG, - booleans::NONMINIMAL_BOOL, collapsible_if::COLLAPSIBLE_IF, copies::IF_SAME_THEN_ELSE, copies::IFS_SAME_COND,