@@ -427,7 +427,7 @@ impl<'a> FmtVisitor<'a> {
427
427
428
428
self . format_missing_with_indent ( field. span . lo ) ;
429
429
430
- match field. node . kind {
430
+ let result = match field. node . kind {
431
431
ast:: VariantKind :: TupleVariantKind ( ref types) => {
432
432
let vis = format_visibility ( field. node . vis ) ;
433
433
self . changes . push_str_span ( field. span , vis) ;
@@ -482,23 +482,23 @@ impl<'a> FmtVisitor<'a> {
482
482
"Enum variant exceeded column limit" ) ;
483
483
}
484
484
485
- self . changes . push_str_span ( field. span , & result) ;
486
-
487
- if !last_field || self . config . enum_trailing_comma {
488
- self . changes . push_str_span ( field. span , "," ) ;
489
- }
485
+ result
490
486
} ,
491
487
ast:: VariantKind :: StructVariantKind ( ref struct_def) => {
492
- let result = self . format_struct ( "" ,
493
- field. node . name ,
494
- field. node . vis ,
495
- struct_def,
496
- None ,
497
- field. span ,
498
- self . block_indent ) ;
499
-
500
- self . changes . push_str_span ( field. span , & result)
488
+ // TODO Should limit the width, as we have a trailing comma
489
+ self . format_struct ( "" ,
490
+ field. node . name ,
491
+ field. node . vis ,
492
+ struct_def,
493
+ None ,
494
+ field. span ,
495
+ self . block_indent )
501
496
}
497
+ } ;
498
+ self . changes . push_str_span ( field. span , & result) ;
499
+
500
+ if !last_field || self . config . enum_trailing_comma {
501
+ self . changes . push_str_span ( field. span , "," ) ;
502
502
}
503
503
504
504
self . last_pos = field. span . hi + BytePos ( 1 ) ;
0 commit comments