summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/overly_complex_bool_expr.txt
blob: 65ca18392e756d60c0d68a947dd4aa0c47dd1bb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
### What it does
Checks for boolean expressions that contain terminals that
can be eliminated.

### Why is this bad?
This is most likely a logic bug.

### Known problems
Ignores short circuiting behavior.

### Example
```
// The `b` is unnecessary, the expression is equivalent to `if a`.
if a && b || a { ... }
```

Use instead:
```
if a {}
```