Clarify guide for unbraced closures: grammatical consistency
This commit is contained in:
parent
2fc1de3c96
commit
9539af86c3
1 changed files with 3 additions and 3 deletions
|
@ -125,9 +125,9 @@ 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, there are comments in the body, or the
|
a return type, when there are statements, when there are comments in the body,
|
||||||
body expression spans multiple lines and is a control-flow expression. If using
|
or when the body expression spans multiple lines and is a control-flow
|
||||||
braces, follow the rules above for blocks. Examples:
|
expression. If using braces, follow the rules above for blocks. Examples:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
|arg1, arg2| expr
|
|arg1, arg2| expr
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue