@@ -507,8 +507,6 @@ impl<'a> FmtVisitor<'a> {
507
507
508
508
let result = match field. node . kind {
509
509
ast:: VariantKind :: TupleVariantKind ( ref types) => {
510
- let vis = format_visibility ( field. node . vis ) ;
511
- self . buffer . push_str ( vis) ;
512
510
let name = field. node . name . to_string ( ) ;
513
511
self . buffer . push_str ( & name) ;
514
512
@@ -531,8 +529,7 @@ impl<'a> FmtVisitor<'a> {
531
529
532
530
result. push ( '(' ) ;
533
531
534
- let indent = self . block_indent + vis. len ( ) + field. node . name . to_string ( ) . len ( ) +
535
- 1 ; // Open paren
532
+ let indent = self . block_indent + field. node . name . to_string ( ) . len ( ) + "(" . len ( ) ;
536
533
537
534
let comma_cost = if self . config . enum_trailing_comma {
538
535
1
@@ -565,9 +562,8 @@ impl<'a> FmtVisitor<'a> {
565
562
result. push_str ( & expr_snippet) ;
566
563
567
564
// Make sure we do not exceed column limit
568
- // 4 = " = ,"
569
565
assert ! ( self . config. max_width >=
570
- vis . len( ) + name . len( ) + expr_snippet . len( ) + 4 ,
566
+ name . len( ) + expr_snippet . len( ) + " = ," . len( ) ,
571
567
"Enum variant exceeded column limit" ) ;
572
568
}
573
569
@@ -577,7 +573,7 @@ impl<'a> FmtVisitor<'a> {
577
573
// TODO: Should limit the width, as we have a trailing comma
578
574
let struct_rewrite = self . format_struct ( "" ,
579
575
field. node . name ,
580
- field . node . vis ,
576
+ ast :: Visibility :: Inherited ,
581
577
struct_def,
582
578
None ,
583
579
field. span ,
0 commit comments