mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
if a < b { ... } if a >= b { ... } what am I doing?
This commit is contained in:
parent
37cee84c44
commit
76ab801001
1 changed files with 2 additions and 4 deletions
|
@ -227,10 +227,8 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
|
|||
if stats[i] < simplified_stats[i] {
|
||||
continue 'simplified;
|
||||
}
|
||||
// if the number of occurrences of a terminal decreases, this expression is a candidate for improvement
|
||||
if stats[i] >= simplified_stats[i] {
|
||||
improvement = true;
|
||||
}
|
||||
// if the number of occurrences of a terminal doesn't increase, this expression is a candidate for improvement
|
||||
improvement = true;
|
||||
if stats[i] != 0 && simplified_stats[i] == 0 {
|
||||
span_lint_and_then(self.0, LOGIC_BUG, e.span, "this boolean expression contains a logic bug", |db| {
|
||||
db.span_help(h2q.terminals[i].span, "this expression can be optimized out by applying boolean operations to the outer expression");
|
||||
|
|
Loading…
Reference in a new issue