Put the second element of a chain on its own line when block formatting.

This commit is contained in:
Nick Cameron 2017-03-28 10:50:58 +13:00
parent 8bca85c4b6
commit 038436919d

View File

@ -113,7 +113,8 @@ pub fn rewrite_chain(expr: &ast::Expr, context: &RewriteContext, shape: Shape) -
} else {
chain_indent(context, shape.add_offset(parent_rewrite.len()))
};
(nested_shape, true)
(nested_shape, context.config.chain_indent == IndentStyle::Visual ||
parent_rewrite.len() <= context.config.tab_spaces)
} else if is_block_expr(&parent, &parent_rewrite) {
// The parent is a block, so align the rest of the chain with the closing
// brace.