diff --git a/src/chains.rs b/src/chains.rs index 4eda33d9647..70e6d951c2d 100644 --- a/src/chains.rs +++ b/src/chains.rs @@ -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.