File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ pub fn format_expr(
228
228
}
229
229
ast:: ExprKind :: Repeat ( ref expr, ref repeats) => rewrite_pair (
230
230
& * * expr,
231
- & * * repeats,
231
+ & * repeats. value ,
232
232
PairParts :: new ( "[" , "; " , "]" ) ,
233
233
context,
234
234
shape,
@@ -1469,8 +1469,9 @@ fn is_simple_expr(expr: &ast::Expr) -> bool {
1469
1469
| ast:: ExprKind :: Field ( ref expr, _)
1470
1470
| ast:: ExprKind :: Try ( ref expr)
1471
1471
| ast:: ExprKind :: Unary ( _, ref expr) => is_simple_expr ( expr) ,
1472
- ast:: ExprKind :: Index ( ref lhs, ref rhs) | ast:: ExprKind :: Repeat ( ref lhs, ref rhs) => {
1473
- is_simple_expr ( lhs) && is_simple_expr ( rhs)
1472
+ ast:: ExprKind :: Index ( ref lhs, ref rhs) => is_simple_expr ( lhs) && is_simple_expr ( rhs) ,
1473
+ ast:: ExprKind :: Repeat ( ref lhs, ref rhs) => {
1474
+ is_simple_expr ( lhs) && is_simple_expr ( & * rhs. value )
1474
1475
}
1475
1476
_ => false ,
1476
1477
}
Original file line number Diff line number Diff line change @@ -572,7 +572,7 @@ impl<'a> FmtVisitor<'a> {
572
572
ast:: VariantData :: Unit ( ..) => {
573
573
if let Some ( ref expr) = field. node . disr_expr {
574
574
let lhs = format ! ( "{} =" , field. node. ident. name) ;
575
- rewrite_assign_rhs ( & context, lhs, & * * expr, shape) ?
575
+ rewrite_assign_rhs ( & context, lhs, & * expr. value , shape) ?
576
576
} else {
577
577
field. node . ident . name . to_string ( )
578
578
}
Original file line number Diff line number Diff line change @@ -656,7 +656,7 @@ impl Rewrite for ast::Ty {
656
656
}
657
657
ast:: TyKind :: Array ( ref ty, ref repeats) => rewrite_pair (
658
658
& * * ty,
659
- & * * repeats,
659
+ & * repeats. value ,
660
660
PairParts :: new ( "[" , "; " , "]" ) ,
661
661
context,
662
662
shape,
You can’t perform that action at this time.
0 commit comments