Skip to content

Commit 2077855

Browse files
committed
Remove NestedImport tactic
1 parent ea54065 commit 2077855

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

src/config/lists.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ pub enum DefinitiveListTactic {
1919
Vertical,
2020
Horizontal,
2121
Mixed,
22-
/// Tactic for nested import.
23-
NestedImport,
2422
/// Special case tactic for `format!()`, `write!()` style macros.
2523
SpecialMacro(usize),
2624
}

src/imports.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -706,16 +706,12 @@ fn rewrite_nested_use_tree(
706706
shape.width.saturating_sub(2)
707707
};
708708

709-
let tactic = if has_nested_list {
710-
DefinitiveListTactic::NestedImport
711-
} else {
712-
definitive_tactic(
713-
&list_items,
714-
context.config.imports_layout(),
715-
Separator::Comma,
716-
remaining_width,
717-
)
718-
};
709+
let tactic = definitive_tactic(
710+
&list_items,
711+
context.config.imports_layout(),
712+
Separator::Comma,
713+
remaining_width,
714+
);
719715

720716
let ends_with_newline = context.config.imports_indent() == IndentStyle::Block
721717
&& tactic != DefinitiveListTactic::Horizontal;

src/lists.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,13 @@ where
282282
result.push('\n');
283283
result.push_str(indent_str);
284284
}
285-
DefinitiveListTactic::Mixed | DefinitiveListTactic::NestedImport => {
285+
DefinitiveListTactic::Mixed => {
286286
let total_width = total_item_width(item) + item_sep_len;
287287

288288
// 1 is space between separator and item.
289289
if (line_len > 0 && line_len + 1 + total_width > formatting.shape.width)
290290
|| prev_item_had_post_comment
291-
|| (tactic == DefinitiveListTactic::NestedImport
292-
&& (prev_item_is_nested_import || (!first && inner_item.contains("::"))))
291+
|| (prev_item_is_nested_import || (!first && inner_item.contains("::")))
293292
{
294293
result.push('\n');
295294
result.push_str(indent_str);

0 commit comments

Comments
 (0)