Fix last chain item shape for Visual indent_style

This commit is contained in:
Ivan Molodetskikh 2018-09-11 11:08:28 +03:00
parent abcdc0fadd
commit 4b4fb557d7
No known key found for this signature in database
GPG Key ID: 02CE38DA47E9D691

View File

@ -614,6 +614,12 @@ impl<'a> ChainFormatterShared<'a> {
}
}
let last_shape = if context.use_block_indent() {
last_shape
} else {
child_shape.sub_width(shape.rhs_overhead(context.config) + last.tries)?
};
last_subexpr_str = last_subexpr_str.or_else(|| last.rewrite(context, last_shape));
self.rewrites.push(last_subexpr_str?);
Some(())