mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-09 07:04:02 +00:00
Fix indent of chain with small parent
This commit is contained in:
parent
b45a69699a
commit
0c1eb20575
@ -150,7 +150,11 @@ pub fn rewrite_chain(expr: &ast::Expr, context: &RewriteContext, shape: Shape) -
|
||||
.collect::<Option<Vec<_>>>()?;
|
||||
|
||||
// Total of all items excluding the last.
|
||||
let extend_last_subexpr = last_line_extendable(&parent_rewrite) && rewrites.is_empty();
|
||||
let extend_last_subexpr = if is_small_parent {
|
||||
rewrites.len() == 1 && last_line_extendable(&rewrites[0])
|
||||
} else {
|
||||
rewrites.is_empty() && last_line_extendable(&parent_rewrite)
|
||||
};
|
||||
let almost_total = if extend_last_subexpr {
|
||||
last_line_width(&parent_rewrite)
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user