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
1 changed files with 51 additions and 0 deletions
|
@ -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 a new issue