Skip to content

Commit 1f0c20e

Browse files
Merge #11345
11345: minor: fix a typo in the style guide r=Veykril a=WaffleLapkin An example of preferring `<`/`<=` over `>`/`>=` was using `>`. Co-authored-by: Waffle Maybe <[email protected]>
2 parents 2cb85c1 + 6ab66d4 commit 1f0c20e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/dev/style.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,13 +927,13 @@ When doing multiple comparisons use `<`/`<=`, avoid `>`/`>=`.
927927
assert!(lo <= x && x <= hi);
928928
assert!(r1 < l2 || r2 < l1);
929929
assert!(x < y);
930-
assert!(x > 0);
930+
assert!(0 < x);
931931

932932
// BAD
933933
assert!(x >= lo && x <= hi);
934934
assert!(r1 < l2 || l1 > r2);
935935
assert!(y > x);
936-
assert!(0 > x);
936+
assert!(x > 0);
937937
```
938938

939939
**Rationale:** Less-then comparisons are more intuitive, they correspond spatially to [real line](https://en.wikipedia.org/wiki/Real_line).

0 commit comments

Comments
 (0)