Skip to content

Commit

Permalink
docs: clarify match_arm_blocks config documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
calebcartwright committed Jul 5, 2021
1 parent a69f56a commit 2837ca5
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions Configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,9 @@ Copyright 2018 The Rust Project Developers.`, etc.:

## `match_arm_blocks`

Wrap the body of arms in blocks when it does not fit on the same line with the pattern of arms
Controls whether arm bodies are wrapped in cases where the first line of the body cannot fit on the same line as the `=>` operator.

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.

- **Default value**: `true`
- **Possible values**: `true`, `false`
Expand All @@ -1486,10 +1488,16 @@ Wrap the body of arms in blocks when it does not fit on the same line with the p
```rust
fn main() {
match lorem {
true => {
ipsum => {
foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
}
false => println!("{}", sit),
dolor => println!("{}", sit),
sit => foo(
"foooooooooooooooooooooooo",
"baaaaaaaaaaaaaaaaaaaaaaaarr",
"baaaaaaaaaaaaaaaaaaaazzzzzzzzzzzzz",
"qqqqqqqqquuuuuuuuuuuuuuuuuuuuuuuuuuxxx",
),
}
}
```
Expand All @@ -1499,9 +1507,15 @@ fn main() {
```rust
fn main() {
match lorem {
true =>
lorem =>
foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
false => println!("{}", sit),
ipsum => println!("{}", sit),
sit => foo(
"foooooooooooooooooooooooo",
"baaaaaaaaaaaaaaaaaaaaaaaarr",
"baaaaaaaaaaaaaaaaaaaazzzzzzzzzzzzz",
"qqqqqqqqquuuuuuuuuuuuuuuuuuuuuuuuuuxxx",
),
}
}
```
Expand Down

0 comments on commit 2837ca5

Please sign in to comment.