Skip to content

Commit b6645e3

Browse files
authored
Merge pull request #2601 from topecongiro/fix-merge-mess
Fix up merge mess
2 parents 0a48018 + 04227a7 commit b6645e3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/imports.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ fn rewrite_nested_use_tree(
460460
list_item.item = use_tree.rewrite(context, nested_shape);
461461
list_items.push(list_item);
462462
}
463-
let tactic = if use_tree_list.iter().any(|use_segment| {
463+
let (tactic, remaining_width) = if use_tree_list.iter().any(|use_segment| {
464464
use_segment
465465
.path
466466
.last()
@@ -469,14 +469,16 @@ fn rewrite_nested_use_tree(
469469
_ => false,
470470
})
471471
}) {
472-
DefinitiveListTactic::Vertical
472+
(DefinitiveListTactic::Vertical, 0)
473473
} else {
474-
definitive_tactic(
474+
let remaining_width = shape.width.checked_sub(2).unwrap_or(0);
475+
let tactic = definitive_tactic(
475476
&list_items,
476477
context.config.imports_layout(),
477478
Separator::Comma,
478-
shape.width.checked_sub(2).unwrap_or(0),
479-
)
479+
remaining_width,
480+
);
481+
(tactic, remaining_width)
480482
};
481483
let ends_with_newline = context.config.imports_indent() == IndentStyle::Block
482484
&& tactic != DefinitiveListTactic::Horizontal;

0 commit comments

Comments
 (0)