Skip to content

Commit 2837ca5

Browse files
docs: clarify match_arm_blocks config documentation
1 parent a69f56a commit 2837ca5

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

Diff for: Configurations.md

+19-5
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,9 @@ Copyright 2018 The Rust Project Developers.`, etc.:
14751475

14761476
## `match_arm_blocks`
14771477

1478-
Wrap the body of arms in blocks when it does not fit on the same line with the pattern of arms
1478+
Controls whether arm bodies are wrapped in cases where the first line of the body cannot fit on the same line as the `=>` operator.
1479+
1480+
The Style Guide requires that bodies are block wrapped by default if a line break is required after the `=>`, but this option can be used to disable that behavior to prevent wrapping arm bodies in that event, so long as the body does not contain multiple statements nor line comments.
14791481

14801482
- **Default value**: `true`
14811483
- **Possible values**: `true`, `false`
@@ -1486,10 +1488,16 @@ Wrap the body of arms in blocks when it does not fit on the same line with the p
14861488
```rust
14871489
fn main() {
14881490
match lorem {
1489-
true => {
1491+
ipsum => {
14901492
foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
14911493
}
1492-
false => println!("{}", sit),
1494+
dolor => println!("{}", sit),
1495+
sit => foo(
1496+
"foooooooooooooooooooooooo",
1497+
"baaaaaaaaaaaaaaaaaaaaaaaarr",
1498+
"baaaaaaaaaaaaaaaaaaaazzzzzzzzzzzzz",
1499+
"qqqqqqqqquuuuuuuuuuuuuuuuuuuuuuuuuuxxx",
1500+
),
14931501
}
14941502
}
14951503
```
@@ -1499,9 +1507,15 @@ fn main() {
14991507
```rust
15001508
fn main() {
15011509
match lorem {
1502-
true =>
1510+
lorem =>
15031511
foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
1504-
false => println!("{}", sit),
1512+
ipsum => println!("{}", sit),
1513+
sit => foo(
1514+
"foooooooooooooooooooooooo",
1515+
"baaaaaaaaaaaaaaaaaaaaaaaarr",
1516+
"baaaaaaaaaaaaaaaaaaaazzzzzzzzzzzzz",
1517+
"qqqqqqqqquuuuuuuuuuuuuuuuuuuuuuuuuuxxx",
1518+
),
15051519
}
15061520
}
15071521
```

0 commit comments

Comments
 (0)