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

Commit 9a5a861

Browse files
committed
Reduce the max width by the width of indent
1 parent 71dc033 commit 9a5a861

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/macros.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,12 +1277,10 @@ impl MacroBranch {
12771277
let body_indent = if has_block_body {
12781278
shape.indent
12791279
} else {
1280-
// We'll hack the indent below, take this into account when formatting,
1281-
let body_indent = shape.indent.block_indent(&config);
1282-
let new_width = config.max_width() - body_indent.width();
1283-
config.set().max_width(new_width);
1284-
body_indent
1280+
shape.indent.block_indent(&config)
12851281
};
1282+
let new_width = config.max_width() - body_indent.width();
1283+
config.set().max_width(new_width);
12861284

12871285
// First try to format as items, then as statements.
12881286
let new_body = match ::format_snippet(&body_str, &config) {

0 commit comments

Comments
 (0)