Fix tests

This commit is contained in:
Nick Cameron 2018-04-14 10:20:08 +12:00
parent 01c1f99e39
commit 1415a4dc23
2 changed files with 6 additions and 5 deletions

View file

@ -393,8 +393,9 @@ fn pop_expr_chain(expr: &ast::Expr, context: &RewriteContext) -> Option<ast::Exp
ast::ExprKind::MethodCall(_, ref expressions) => {
Some(convert_try(&expressions[0], context))
}
| ast::ExprKind::Field(ref subexpr, _)
| ast::ExprKind::Try(ref subexpr) => Some(convert_try(subexpr, context)),
ast::ExprKind::Field(ref subexpr, _) | ast::ExprKind::Try(ref subexpr) => {
Some(convert_try(subexpr, context))
}
_ => None,
}
}

View file

@ -176,9 +176,9 @@ pub fn format_expr(
capture, movability, fn_decl, body, expr.span, context, shape,
)
}
ast::ExprKind::Try(..)
| ast::ExprKind::Field(..)
| ast::ExprKind::MethodCall(..) => rewrite_chain(expr, context, shape),
ast::ExprKind::Try(..) | ast::ExprKind::Field(..) | ast::ExprKind::MethodCall(..) => {
rewrite_chain(expr, context, shape)
}
ast::ExprKind::Mac(ref mac) => {
rewrite_macro(mac, None, context, shape, MacroPosition::Expression).or_else(|| {
wrap_str(