Skip to content

Commit 0a626ce

Browse files
committed
Explicitly state result of compound assignment
The existing text implies but doesn't explicitly say that compound assignment produces the unit value. A reader could also infer it from the signatures of the compound assignment trait functions, but it seems better to be explicit.
1 parent a66f0af commit 0a626ce

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/expressions/operator-expr.md

+2
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ fn example() {
470470
}
471471
```
472472

473+
Like assignment expressions, compound assignment expressions always produce [the unit value][unit].
474+
473475
<div class="warning">
474476

475477
Warning: The evaluation order of operands swaps depending on the types of the operands:

0 commit comments

Comments
 (0)