Don't put a newline before ? when it is the second sub-expression in a chain (#1012)

Fixes #1003
This commit is contained in:
Nick Cameron 2016-05-27 20:33:19 +12:00 committed by Marcus Klaas de Vries
parent 775de8a62b
commit d6bcfceb7e
3 changed files with 21 additions and 1 deletions

View file

@ -179,7 +179,9 @@ pub fn rewrite_chain(expr: &ast::Expr,
format!("\n{}", indent.to_string(context.config))
};
let first_connector = if extend {
let first_connector = if extend || subexpr_list.len() == 0 {
""
} else if let ast::ExprKind::Try(_) = subexpr_list[0].node {
""
} else {
&*connector