Use correct width

When rewriting trait bounds on the next line, we do not want to add an extra
indentation. However, the max width should be smaller.
This commit is contained in:
Seiichi Uchida 2018-10-14 21:44:56 +09:00
parent fdfb489c48
commit 5f5d04283c

View file

@ -1937,7 +1937,9 @@ fn shape_from_rhs_tactic(
rhs_tactic: RhsTactics,
) -> Option<Shape> {
match rhs_tactic {
RhsTactics::ForceNextLineWithoutIndent => Some(shape.with_max_width(context.config)),
RhsTactics::ForceNextLineWithoutIndent => shape
.with_max_width(context.config)
.sub_width(shape.indent.width()),
RhsTactics::Default => {
Shape::indented(shape.indent.block_indent(context.config), context.config)
.sub_width(shape.rhs_overhead(context.config))