@@ -2369,22 +2369,10 @@ impl<'a> State<'a> {
2369
2369
self . print_pat ( p) ;
2370
2370
}
2371
2371
}
2372
- PatKind :: TupleStruct ( ref path, ref elts, ddpos ) => {
2372
+ PatKind :: TupleStruct ( ref path, ref elts) => {
2373
2373
self . print_path ( path, true , 0 ) ;
2374
2374
self . popen ( ) ;
2375
- if let Some ( ddpos) = ddpos {
2376
- self . commasep ( Inconsistent , & elts[ ..ddpos] , |s, p| s. print_pat ( p) ) ;
2377
- if ddpos != 0 {
2378
- self . word_space ( "," ) ;
2379
- }
2380
- self . s . word ( ".." ) ;
2381
- if ddpos != elts. len ( ) {
2382
- self . s . word ( "," ) ;
2383
- self . commasep ( Inconsistent , & elts[ ddpos..] , |s, p| s. print_pat ( p) ) ;
2384
- }
2385
- } else {
2386
- self . commasep ( Inconsistent , & elts[ ..] , |s, p| s. print_pat ( p) ) ;
2387
- }
2375
+ self . commasep ( Inconsistent , & elts[ ..] , |s, p| s. print_pat ( p) ) ;
2388
2376
self . pclose ( ) ;
2389
2377
}
2390
2378
PatKind :: Path ( None , ref path) => {
@@ -2416,23 +2404,11 @@ impl<'a> State<'a> {
2416
2404
self . s . space ( ) ;
2417
2405
self . s . word ( "}" ) ;
2418
2406
}
2419
- PatKind :: Tuple ( ref elts, ddpos ) => {
2407
+ PatKind :: Tuple ( ref elts) => {
2420
2408
self . popen ( ) ;
2421
- if let Some ( ddpos) = ddpos {
2422
- self . commasep ( Inconsistent , & elts[ ..ddpos] , |s, p| s. print_pat ( p) ) ;
2423
- if ddpos != 0 {
2424
- self . word_space ( "," ) ;
2425
- }
2426
- self . s . word ( ".." ) ;
2427
- if ddpos != elts. len ( ) {
2428
- self . s . word ( "," ) ;
2429
- self . commasep ( Inconsistent , & elts[ ddpos..] , |s, p| s. print_pat ( p) ) ;
2430
- }
2431
- } else {
2432
- self . commasep ( Inconsistent , & elts[ ..] , |s, p| s. print_pat ( p) ) ;
2433
- if elts. len ( ) == 1 {
2434
- self . s . word ( "," ) ;
2435
- }
2409
+ self . commasep ( Inconsistent , & elts[ ..] , |s, p| s. print_pat ( p) ) ;
2410
+ if elts. len ( ) == 1 {
2411
+ self . s . word ( "," ) ;
2436
2412
}
2437
2413
self . pclose ( ) ;
2438
2414
}
@@ -2458,24 +2434,9 @@ impl<'a> State<'a> {
2458
2434
}
2459
2435
self . print_expr ( end) ;
2460
2436
}
2461
- PatKind :: Slice ( ref before , ref slice , ref after ) => {
2437
+ PatKind :: Slice ( ref elts ) => {
2462
2438
self . s . word ( "[" ) ;
2463
- self . commasep ( Inconsistent ,
2464
- & before[ ..] ,
2465
- |s, p| s. print_pat ( p) ) ;
2466
- if let Some ( ref p) = * slice {
2467
- if !before. is_empty ( ) { self . word_space ( "," ) ; }
2468
- if let PatKind :: Wild = p. node {
2469
- // Print nothing
2470
- } else {
2471
- self . print_pat ( p) ;
2472
- }
2473
- self . s . word ( ".." ) ;
2474
- if !after. is_empty ( ) { self . word_space ( "," ) ; }
2475
- }
2476
- self . commasep ( Inconsistent ,
2477
- & after[ ..] ,
2478
- |s, p| s. print_pat ( p) ) ;
2439
+ self . commasep ( Inconsistent , & elts[ ..] , |s, p| s. print_pat ( p) ) ;
2479
2440
self . s . word ( "]" ) ;
2480
2441
}
2481
2442
PatKind :: Rest => self . s . word ( ".." ) ,
0 commit comments