Clarify guide for unbraced closures, regarding comments

This commit is contained in:
Josh Triplett 2020-08-28 16:45:25 -07:00
parent 9539af86c3
commit 9362ae1616

View File

@ -125,8 +125,8 @@ expression of the closure. Between the `|`s, use function definition syntax,
but elide types where possible. but elide types where possible.
Use closures without the enclosing `{}`, if possible. Add the `{}` when you have 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, a return type, when there are statements, when there are comments inside the
or when the body expression spans multiple lines and is a control-flow 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: expression. If using braces, follow the rules above for blocks. Examples:
```rust ```rust