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) => { ast::ExprKind::MethodCall(_, ref expressions) => {
Some(convert_try(&expressions[0], context)) Some(convert_try(&expressions[0], context))
} }
| ast::ExprKind::Field(ref subexpr, _) ast::ExprKind::Field(ref subexpr, _) | ast::ExprKind::Try(ref subexpr) => {
| ast::ExprKind::Try(ref subexpr) => Some(convert_try(subexpr, context)), Some(convert_try(subexpr, context))
}
_ => None, _ => None,
} }
} }

View File

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