We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e3d6bf8 + 6e87f86 commit 327903eCopy full SHA for 327903e
src/expr.rs
@@ -256,7 +256,7 @@ pub(crate) fn format_expr(
256
shape,
257
SeparatorPlace::Back,
258
),
259
- ast::ExprKind::Index(ref expr, ref index) => {
+ ast::ExprKind::Index(ref expr, ref index, _) => {
260
rewrite_index(&**expr, &**index, context, shape)
261
}
262
ast::ExprKind::Repeat(ref expr, ref repeats) => rewrite_pair(
@@ -1342,7 +1342,7 @@ pub(crate) fn is_simple_expr(expr: &ast::Expr) -> bool {
1342
| ast::ExprKind::Field(ref expr, _)
1343
| ast::ExprKind::Try(ref expr)
1344
| ast::ExprKind::Unary(_, ref expr) => is_simple_expr(expr),
1345
- ast::ExprKind::Index(ref lhs, ref rhs) => is_simple_expr(lhs) && is_simple_expr(rhs),
+ ast::ExprKind::Index(ref lhs, ref rhs, _) => is_simple_expr(lhs) && is_simple_expr(rhs),
1346
ast::ExprKind::Repeat(ref lhs, ref rhs) => {
1347
is_simple_expr(lhs) && is_simple_expr(&*rhs.value)
1348
src/matches.rs
@@ -594,7 +594,7 @@ fn can_flatten_block_around_this(body: &ast::Expr) -> bool {
594
ast::ExprKind::AddrOf(_, _, ref expr)
595
596
| ast::ExprKind::Unary(_, ref expr)
597
- | ast::ExprKind::Index(ref expr, _)
+ | ast::ExprKind::Index(ref expr, _, _)
598
| ast::ExprKind::Cast(ref expr, _) => can_flatten_block_around_this(expr),
599
_ => false,
600
src/utils.rs
@@ -441,7 +441,7 @@ pub(crate) fn left_most_sub_expr(e: &ast::Expr) -> &ast::Expr {
441
| ast::ExprKind::Assign(ref e, _, _)
442
| ast::ExprKind::AssignOp(_, ref e, _)
443
| ast::ExprKind::Field(ref e, _)
444
- | ast::ExprKind::Index(ref e, _)
+ | ast::ExprKind::Index(ref e, _, _)
445
| ast::ExprKind::Range(Some(ref e), _, _)
446
| ast::ExprKind::Try(ref e) => left_most_sub_expr(e),
447
_ => e,
@@ -479,7 +479,7 @@ pub(crate) fn is_block_expr(context: &RewriteContext<'_>, expr: &ast::Expr, repr
479
| ast::ExprKind::Match(..) => repr.contains('\n'),
480
ast::ExprKind::Paren(ref expr)
481
| ast::ExprKind::Binary(_, _, ref expr)
482
- | ast::ExprKind::Index(_, ref expr)
+ | ast::ExprKind::Index(_, ref expr, _)
483
484
485
| ast::ExprKind::Yield(Some(ref expr)) => is_block_expr(context, expr, repr),
0 commit comments