Skip to content

Commit a6b32d9

Browse files
committed
Fix breaking changes from introducing AnonConst
1 parent 6c7c770 commit a6b32d9

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/expr.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ pub fn format_expr(
228228
}
229229
ast::ExprKind::Repeat(ref expr, ref repeats) => rewrite_pair(
230230
&**expr,
231-
&**repeats,
231+
&*repeats.value,
232232
PairParts::new("[", "; ", "]"),
233233
context,
234234
shape,
@@ -1469,8 +1469,9 @@ fn is_simple_expr(expr: &ast::Expr) -> bool {
14691469
| ast::ExprKind::Field(ref expr, _)
14701470
| ast::ExprKind::Try(ref expr)
14711471
| 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)
14741475
}
14751476
_ => false,
14761477
}

src/items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ impl<'a> FmtVisitor<'a> {
572572
ast::VariantData::Unit(..) => {
573573
if let Some(ref expr) = field.node.disr_expr {
574574
let lhs = format!("{} =", field.node.ident.name);
575-
rewrite_assign_rhs(&context, lhs, &**expr, shape)?
575+
rewrite_assign_rhs(&context, lhs, &*expr.value, shape)?
576576
} else {
577577
field.node.ident.name.to_string()
578578
}

src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ impl Rewrite for ast::Ty {
656656
}
657657
ast::TyKind::Array(ref ty, ref repeats) => rewrite_pair(
658658
&**ty,
659-
&**repeats,
659+
&*repeats.value,
660660
PairParts::new("[", "; ", "]"),
661661
context,
662662
shape,

0 commit comments

Comments
 (0)