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

Commit 4b4fb55

Browse files
committed
Fix last chain item shape for Visual indent_style
1 parent abcdc0f commit 4b4fb55

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/chains.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,12 @@ impl<'a> ChainFormatterShared<'a> {
614614
}
615615
}
616616

617+
let last_shape = if context.use_block_indent() {
618+
last_shape
619+
} else {
620+
child_shape.sub_width(shape.rhs_overhead(context.config) + last.tries)?
621+
};
622+
617623
last_subexpr_str = last_subexpr_str.or_else(|| last.rewrite(context, last_shape));
618624
self.rewrites.push(last_subexpr_str?);
619625
Some(())

0 commit comments

Comments
 (0)