File tree 5 files changed +8
-8
lines changed
source/configs/match_arm_leading_pipes
target/configs/match_arm_leading_pipes
5 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -1550,7 +1550,7 @@ See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
1550
1550
Controls whether to include a leading pipe on match arms
1551
1551
1552
1552
- ** Default value** : ` Never `
1553
- - ** Possible values** : ` Always ` , ` Never ` , ` KeepExisting `
1553
+ - ** Possible values** : ` Always ` , ` Never ` , ` Preserve `
1554
1554
- ** Stable** : Yes
1555
1555
1556
1556
#### ` Never ` (default):
@@ -1607,7 +1607,7 @@ fn foo() {
1607
1607
}
1608
1608
```
1609
1609
1610
- #### ` KeepExisting ` :
1610
+ #### ` Preserve ` :
1611
1611
``` rust
1612
1612
fn foo () {
1613
1613
match foo {
Original file line number Diff line number Diff line change @@ -355,8 +355,8 @@ pub enum MatchArmLeadingPipe {
355
355
Always ,
356
356
/// Never emit leading pipes on match arms
357
357
Never ,
358
- /// Maintain any existing leading pipes
359
- KeepExisting ,
358
+ /// Preserve any existing leading pipes
359
+ Preserve ,
360
360
}
361
361
362
362
#[ cfg( test) ]
Original file line number Diff line number Diff line change @@ -244,8 +244,8 @@ fn rewrite_match_arm(
244
244
// 2 = `| `
245
245
let ( pipe_offset, pipe_str) = match context. config . match_arm_leading_pipes ( ) {
246
246
MatchArmLeadingPipe :: Never => ( 0 , "" ) ,
247
- MatchArmLeadingPipe :: KeepExisting if !has_leading_pipe => ( 0 , "" ) ,
248
- MatchArmLeadingPipe :: KeepExisting | MatchArmLeadingPipe :: Always => ( 2 , "| " ) ,
247
+ MatchArmLeadingPipe :: Preserve if !has_leading_pipe => ( 0 , "" ) ,
248
+ MatchArmLeadingPipe :: Preserve | MatchArmLeadingPipe :: Always => ( 2 , "| " ) ,
249
249
} ;
250
250
251
251
// Patterns
Original file line number Diff line number Diff line change 1
- // rustfmt-match_arm_leading_pipes: KeepExisting
1
+ // rustfmt-match_arm_leading_pipes: Preserve
2
2
3
3
fn foo ( ) {
4
4
match foo {
Original file line number Diff line number Diff line change 1
- // rustfmt-match_arm_leading_pipes: KeepExisting
1
+ // rustfmt-match_arm_leading_pipes: Preserve
2
2
3
3
fn foo ( ) {
4
4
match foo {
You can’t perform that action at this time.
0 commit comments