style-guide: Fix chain example to match rustfmt behavior
The style guide gave an example of breaking a multi-line chain element and all subsequent elements to a new line, but that same example and the accompanying text also had several chain items stacked on the first line. rustfmt doesn't do this, except when the rule saying to combine ``` shrt .y() ``` into ``` shrt.y() ``` applies.
This commit is contained in:
parent
5dac6b320b
commit
24534cffe6
@ -450,12 +450,11 @@ foo(
|
|||||||
|
|
||||||
#### Multi-line elements
|
#### Multi-line elements
|
||||||
|
|
||||||
If any element in a chain is formatted across multiple lines, then that element
|
If any element in a chain is formatted across multiple lines, put that element
|
||||||
and any later elements must be on their own line. Earlier elements may be kept
|
and any later elements on their own lines.
|
||||||
on a single line. E.g.,
|
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
a.b.c()?.d
|
a.b.c()?
|
||||||
.foo(
|
.foo(
|
||||||
an_expr,
|
an_expr,
|
||||||
another_expr,
|
another_expr,
|
||||||
|
Loading…
Reference in New Issue
Block a user