Skip to content

Commit 2bf4747

Browse files
committed
Take width of return type into account
1 parent 40e6c26 commit 2bf4747

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/expr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,6 @@ fn rewrite_closure_fn_decl(
585585
};
586586
let list_str = write_list(&item_vec, &fmt)?;
587587
let mut prefix = format!("{}|{}|", mover, list_str);
588-
// 1 = space between `|...|` and body.
589-
let extra_offset = extra_offset(&prefix, shape) + 1;
590588

591589
if !ret_str.is_empty() {
592590
if prefix.contains('\n') {
@@ -597,6 +595,8 @@ fn rewrite_closure_fn_decl(
597595
}
598596
prefix.push_str(&ret_str);
599597
}
598+
// 1 = space between `|...|` and body.
599+
let extra_offset = last_line_width(&prefix) + 1;
600600

601601
Some((prefix, extra_offset))
602602
}

0 commit comments

Comments
 (0)