mirror of
https://github.com/rust-lang/rust.git
synced 2026-03-19 14:08:50 +00:00
Simplify wording in guide for unbraced closures
This commit is contained in:
@@ -126,8 +126,8 @@ 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 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:
|
||||
closure, or when the body expression is a control-flow expression that spans
|
||||
multiple lines. If using braces, follow the rules above for blocks. Examples:
|
||||
|
||||
```rust
|
||||
|arg1, arg2| expr
|
||||
|
||||
Reference in New Issue
Block a user