Skip to content

Commit c13947d

Browse files
authored
Merge pull request #130 from rust-lang-nursery/bin-ops-multiline
Clarify multiline behaviour of binops
2 parents 0593f9a + b3b37a9 commit c13947d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

guide/expressions.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,15 @@ Use parentheses liberally, do not necessarily elide them due to precedence.
295295
Tools should not automatically insert or remove parentheses. Do not use spaces
296296
to indicate precedence.
297297

298-
If line-breaking, put the operator on a new line and block indent. E.g.,
298+
If line-breaking, put the operator on a new line and block indent. Put each
299+
sub-expression on its own line. E.g.,
299300

300301
```rust
301-
foo + bar + baz
302-
+ qux + whatever
302+
foo_bar
303+
+ bar
304+
+ baz
305+
+ qux
306+
+ whatever
303307
```
304308

305309
Prefer line-breaking at an assignment operator (either `=` or `+=`, etc.) rather

0 commit comments

Comments
 (0)