Skip to content

Commit 48bdecf

Browse files
committed
Add Configurations.md section
1 parent 84bea05 commit 48bdecf

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

Configurations.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,48 @@ struct Dolor<T>
12291229
}
12301230
```
12311231

1232+
## `match_arm_forces_newline`
1233+
1234+
Consistently put match arms (block based or not) in a newline.
1235+
1236+
- **Default value**: `false`
1237+
- **Possible values**: `true`, `false`
1238+
1239+
#### `false` (default):
1240+
1241+
```rust
1242+
match x {
1243+
// a non-empty block
1244+
X0 => {
1245+
f();
1246+
}
1247+
// an empty block
1248+
X1 => {}
1249+
// a non-block
1250+
X2 => println!("ok"),
1251+
}
1252+
```
1253+
1254+
#### `true`:
1255+
1256+
```rust
1257+
match x {
1258+
// a non-empty block
1259+
X0 => {
1260+
f();
1261+
}
1262+
// an empty block
1263+
X1 =>
1264+
{}
1265+
// a non-block
1266+
X2 => {
1267+
println!("ok")
1268+
}
1269+
}
1270+
```
1271+
1272+
See also: [`wrap_match_arms`](#wrap_match_arms).
1273+
12321274
## `match_block_trailing_comma`
12331275

12341276
Put a trailing comma after a block based match arm (non-block arms are not affected)

0 commit comments

Comments
 (0)