Skip to content

Commit c6f4de7

Browse files
authored
Merge pull request #41 from ekse/parentheses-chained-comparisons
Document that parentheses are required for chained comparison operators (RFC 0).
2 parents b060f73 + 0a55590 commit c6f4de7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/expressions.md

+3
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,9 @@ operators on standard types is given here.
436436
: Greater than or equal.
437437
Calls the `ge` method on the `std::cmp::PartialOrd` trait.
438438

439+
Parentheses are required when chaining comparison operators. For example, the
440+
expression `a == b == c` is invalid and may be written as `(a == b) == c`.
441+
439442
### Type cast expressions
440443

441444
A type cast expression is denoted with the binary operator `as`.

0 commit comments

Comments
 (0)