Skip to content

Commit

Permalink
docs: add leading pipe config details
Browse files Browse the repository at this point in the history
  • Loading branch information
calebcartwright committed Apr 18, 2020
1 parent 272a6cf commit 6d87061
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions Configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2080,6 +2080,55 @@ println!("os is not pi!");
println!("os is not pi!");
```

## `strip_leading_match_arm_pipes`

Controls whether to remove leading pipes from match arms

- **Default value**: `true`
- **Possible values**: `true`, `false`
- **Stable**: Yes

#### `true`:
```rust
// Leading pipes are from this:
// fn foo() {
// match foo {
// | "foo" | "bar" => {}
// | "baz"
// | "something relatively long"
// | "something really really really realllllllllllllly long" => println!("x"),
// | "qux" => println!("y"),
// _ => {}
// }
// }

// Are removed:
fn foo() {
match foo {
"foo" | "bar" => {}
"baz"
| "something relatively long"
| "something really really really realllllllllllllly long" => println!("x"),
"qux" => println!("y"),
_ => {}
}
}
```

#### `false`:
```rust
fn foo() {
match foo {
| "foo" | "bar" => {}
| "baz"
| "something relatively long"
| "something really really really realllllllllllllly long" => println!("x"),
| "qux" => println!("y"),
_ => {}
}
}
```

## `struct_field_align_threshold`

The maximum diff of width between struct fields to be aligned with each other.
Expand Down

0 comments on commit 6d87061

Please sign in to comment.