mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 12:33:33 +00:00
minor: fix a typo in the style guide
This commit is contained in:
parent
2cb85c14b6
commit
6ab66d4c9a
1 changed files with 2 additions and 2 deletions
|
@ -927,13 +927,13 @@ When doing multiple comparisons use `<`/`<=`, avoid `>`/`>=`.
|
|||
assert!(lo <= x && x <= hi);
|
||||
assert!(r1 < l2 || r2 < l1);
|
||||
assert!(x < y);
|
||||
assert!(x > 0);
|
||||
assert!(0 < x);
|
||||
|
||||
// BAD
|
||||
assert!(x >= lo && x <= hi);
|
||||
assert!(r1 < l2 || l1 > r2);
|
||||
assert!(y > x);
|
||||
assert!(0 > x);
|
||||
assert!(x > 0);
|
||||
```
|
||||
|
||||
**Rationale:** Less-then comparisons are more intuitive, they correspond spatially to [real line](https://en.wikipedia.org/wiki/Real_line).
|
||||
|
|
Loading…
Reference in a new issue