mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-05 05:04:24 +00:00
Merge pull request #2143 from davidalber/add-combine-control-expr-example
Adding an example for `combine_control_expr = false`
This commit is contained in:
commit
896c3a2b7d
@ -354,6 +354,57 @@ fn example() {
|
||||
#### `false`:
|
||||
|
||||
```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`
|
||||
|
Loading…
Reference in New Issue
Block a user