Skip to content

Commit

Permalink
Clarify muliti-line chain elements
Browse files Browse the repository at this point in the history
  • Loading branch information
camsteffen authored May 3, 2021
1 parent 215291e commit 2f84469
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions guide/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -451,16 +451,17 @@ foo(

#### Multi-line elements

If any element in a chain is formatted across multiple lines, then that element
and any later elements must be on their own line. Earlier elements may be kept
on a single line. E.g.,
If any element in a chain is formatted across multiple lines, then all
surrounding elements must be on their own line. Though multiple elements may be
on the first line for reasons described above. E.g.,

```rust
a.b.c()?.d
.foo(
an_expr,
another_expr,
)
a.b.c()?
.d
.foo(|arg| {
a_stmt;
another_stmt;
})
.bar
.baz
```
Expand Down

0 comments on commit 2f84469

Please sign in to comment.