Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 5f5d042

Browse files
committed
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.
1 parent fdfb489 commit 5f5d042

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/expr.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1937,7 +1937,9 @@ fn shape_from_rhs_tactic(
19371937
rhs_tactic: RhsTactics,
19381938
) -> Option<Shape> {
19391939
match rhs_tactic {
1940-
RhsTactics::ForceNextLineWithoutIndent => Some(shape.with_max_width(context.config)),
1940+
RhsTactics::ForceNextLineWithoutIndent => shape
1941+
.with_max_width(context.config)
1942+
.sub_width(shape.indent.width()),
19411943
RhsTactics::Default => {
19421944
Shape::indented(shape.indent.block_indent(context.config), context.config)
19431945
.sub_width(shape.rhs_overhead(context.config))

0 commit comments

Comments
 (0)