]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/nonminimal_bool.txt
Auto merge of #104673 - matthiaskrgr:rollup-85f65ov, r=matthiaskrgr
[rust.git] / src / tools / clippy / src / docs / nonminimal_bool.txt
1 ### What it does
2 Checks for boolean expressions that can be written more
3 concisely.
4
5 ### Why is this bad?
6 Readability of boolean expressions suffers from
7 unnecessary duplication.
8
9 ### Known problems
10 Ignores short circuiting behavior of `||` and
11 `&&`. Ignores `|`, `&` and `^`.
12
13 ### Example
14 ```
15 if a && true {}
16 if !(a == b) {}
17 ```
18
19 Use instead:
20 ```
21 if a {}
22 if a != b {}
23 ```