]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/int_plus_one.txt
:arrow_up: rust-analyzer
[rust.git] / src / tools / clippy / src / docs / int_plus_one.txt
1 ### What it does
2 Checks for usage of `x >= y + 1` or `x - 1 >= y` (and `<=`) in a block
3
4 ### Why is this bad?
5 Readability -- better to use `> y` instead of `>= y + 1`.
6
7 ### Example
8 ```
9 if x >= y + 1 {}
10 ```
11
12 Use instead:
13 ```
14 if x > y {}
15 ```