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

Commit 6277808

Browse files
authored
Merge pull request rust-lang#2987 from YaLTeR/fix-issue-2930
Use correct shape in Visual tuple rewriting
2 parents ec6086b + 6a02997 commit 6277808

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,7 @@ where
17531753
Separator::Comma,
17541754
nested_shape.width,
17551755
);
1756-
let fmt = ListFormatting::new(shape, context.config)
1756+
let fmt = ListFormatting::new(nested_shape, context.config)
17571757
.tactic(tactic)
17581758
.ends_with_newline(false);
17591759
let list_str = write_list(&item_vec, &fmt)?;

tests/source/issue-2930.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// rustfmt-indent_style: Visual
2+
fn main() {
3+
let (first_variable, second_variable) = (this_is_something_with_an_extraordinarily_long_name,
4+
this_variable_name_is_also_pretty_long);
5+
}

tests/target/issue-2930.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// rustfmt-indent_style: Visual
2+
fn main() {
3+
let (first_variable, second_variable) = (this_is_something_with_an_extraordinarily_long_name,
4+
this_variable_name_is_also_pretty_long);
5+
}

0 commit comments

Comments
 (0)