Update wrap_match_arms option tests and visual guide
This commit is contained in:
parent
be55f856bb
commit
c11aac04a3
@ -1986,7 +1986,7 @@ Break comments to fit on the line
|
||||
|
||||
## `wrap_match_arms`
|
||||
|
||||
Wrap multiline match arms in blocks
|
||||
Wrap the body of arms in blocks when it does not fit on the same line with the pattern of arms
|
||||
|
||||
- **Default value**: `true`
|
||||
- **Possible values**: `true`, `false`
|
||||
@ -1995,13 +1995,9 @@ Wrap multiline match arms in blocks
|
||||
|
||||
```rust
|
||||
match lorem {
|
||||
true => {
|
||||
let ipsum = dolor;
|
||||
println!("{}", ipsum);
|
||||
}
|
||||
false => {
|
||||
println!("{}", sit)
|
||||
}
|
||||
true =>
|
||||
foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
|
||||
false => println!("{}", sit),
|
||||
}
|
||||
```
|
||||
|
||||
@ -2010,8 +2006,7 @@ match lorem {
|
||||
```rust
|
||||
match lorem {
|
||||
true => {
|
||||
let ipsum = dolor;
|
||||
println!("{}", ipsum);
|
||||
foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
|
||||
}
|
||||
false => println!("{}", sit),
|
||||
}
|
||||
|
@ -570,7 +570,8 @@ create_config! {
|
||||
wrap_comments: bool, false, "Break comments to fit on the line";
|
||||
comment_width: usize, 80, "Maximum length of comments. No effect unless wrap_comments = true";
|
||||
normalize_comments: bool, false, "Convert /* */ comments to // comments where possible";
|
||||
wrap_match_arms: bool, true, "Wrap multiline match arms in blocks";
|
||||
wrap_match_arms: bool, true, "Wrap the body of arms in blocks when it does not fit on \
|
||||
the same line with the pattern of arms";
|
||||
match_block_trailing_comma: bool, false,
|
||||
"Put a trailing comma after a block based match arm (non-block arms are not affected)";
|
||||
indent_match_arms: bool, true, "Indent match arms instead of keeping them at the same \
|
||||
|
@ -3,10 +3,7 @@
|
||||
|
||||
fn main() {
|
||||
match lorem {
|
||||
true => {
|
||||
let ipsum = dolor;
|
||||
println!("{:?}", ipsum);
|
||||
}
|
||||
true => foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
|
||||
false => {
|
||||
println!("{}", sit)
|
||||
}
|
||||
|
@ -3,10 +3,7 @@
|
||||
|
||||
fn main() {
|
||||
match lorem {
|
||||
true => {
|
||||
let ipsum = dolor;
|
||||
println!("{}", ipsum);
|
||||
}
|
||||
true => foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
|
||||
false => {
|
||||
println!("{}", sit)
|
||||
}
|
||||
|
@ -3,12 +3,8 @@
|
||||
|
||||
fn main() {
|
||||
match lorem {
|
||||
true => {
|
||||
let ipsum = dolor;
|
||||
println!("{:?}", ipsum);
|
||||
}
|
||||
false => {
|
||||
println!("{}", sit)
|
||||
}
|
||||
true =>
|
||||
foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
|
||||
false => println!("{}", sit),
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,7 @@
|
||||
fn main() {
|
||||
match lorem {
|
||||
true => {
|
||||
let ipsum = dolor;
|
||||
println!("{}", ipsum);
|
||||
foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
|
||||
}
|
||||
false => println!("{}", sit),
|
||||
}
|
||||
|
@ -4,9 +4,7 @@
|
||||
|
||||
fn foo() {
|
||||
match x {
|
||||
a => {
|
||||
foo()
|
||||
}
|
||||
a => foo(),
|
||||
b => (
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
|
||||
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
|
||||
|
Loading…
x
Reference in New Issue
Block a user