From 5f5d04283ce68b514a13ae5c41ba3961549ab46f Mon Sep 17 00:00:00 2001 From: Seiichi Uchida Date: Sun, 14 Oct 2018 21:44:56 +0900 Subject: 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. --- src/expr.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/expr.rs') diff --git a/src/expr.rs b/src/expr.rs index 7a6a1473060..8a5b3de7a14 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -1937,7 +1937,9 @@ fn shape_from_rhs_tactic( rhs_tactic: RhsTactics, ) -> Option { 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)) -- cgit 1.4.1-3-g733a5