]> git.lizzy.rs Git - rust.git/blob - src/docs/double_comparisons.txt
Auto merge of #9421 - xphoniex:fix-#9420, r=giraffate
[rust.git] / src / docs / double_comparisons.txt
1 ### What it does
2 Checks for double comparisons that could be simplified to a single expression.
3
4
5 ### Why is this bad?
6 Readability.
7
8 ### Example
9 ```
10 if x == y || x < y {}
11 ```
12
13 Use instead:
14
15 ```
16 if x <= y {}
17 ```