Merge pull request #2143 from davidalber/add-combine-control-expr-example

Adding an example for `combine_control_expr = false`
This commit is contained in:
Seiichi Uchida 2017-11-13 07:44:37 +09:00 committed by GitHub
commit 896c3a2b7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -354,6 +354,57 @@ fn example() {
#### `false`: #### `false`:
```rust ```rust
fn example() {
// If
foo!(
if x {
foo();
} else {
bar();
}
);
// IfLet
foo!(
if let Some(..) = x {
foo();
} else {
bar();
}
);
// While
foo!(
while x {
foo();
bar();
}
);
// WhileLet
foo!(
while let Some(..) = x {
foo();
bar();
}
);
// ForLoop
foo!(
for x in y {
foo();
bar();
}
);
// Loop
foo!(
loop {
foo();
bar();
}
);
}
``` ```
## `comment_width` ## `comment_width`