We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2cb85c1 commit 6ab66d4Copy full SHA for 6ab66d4
docs/dev/style.md
@@ -927,13 +927,13 @@ When doing multiple comparisons use `<`/`<=`, avoid `>`/`>=`.
927
assert!(lo <= x && x <= hi);
928
assert!(r1 < l2 || r2 < l1);
929
assert!(x < y);
930
-assert!(x > 0);
+assert!(0 < x);
931
932
// BAD
933
assert!(x >= lo && x <= hi);
934
assert!(r1 < l2 || l1 > r2);
935
assert!(y > x);
936
-assert!(0 > x);
+assert!(x > 0);
937
```
938
939
**Rationale:** Less-then comparisons are more intuitive, they correspond spatially to [real line](https://en.wikipedia.org/wiki/Real_line).
0 commit comments