Clarify guide for unbraced closures, regarding comments
This commit is contained in:
parent
9539af86c3
commit
9362ae1616
@ -125,8 +125,8 @@ expression of the closure. Between the `|`s, use function definition syntax,
|
||||
but elide types where possible.
|
||||
|
||||
Use closures without the enclosing `{}`, if possible. Add the `{}` when you have
|
||||
a return type, when there are statements, when there are comments in the body,
|
||||
or when the body expression spans multiple lines and is a control-flow
|
||||
a return type, when there are statements, when there are comments inside the
|
||||
closure, or when the body expression spans multiple lines and is a control-flow
|
||||
expression. If using braces, follow the rules above for blocks. Examples:
|
||||
|
||||
```rust
|
||||
|
Loading…
Reference in New Issue
Block a user