Skip to content

Commit 9a6b5c6

Browse files
Enforce alphabetical import sorting
1 parent 1a78991 commit 9a6b5c6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crates/ra_assists/src/assists/auto_import.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,16 @@ pub(crate) fn auto_import<F: ImportsLocator>(
5555
.filter_map(|module_def| module_with_name_to_import.find_use_path(ctx.db, module_def))
5656
.filter(|use_path| !use_path.segments.is_empty())
5757
.take(20)
58-
.collect::<std::collections::HashSet<_>>();
58+
.map(|import| import.to_string())
59+
.collect::<std::collections::BTreeSet<_>>();
5960
if proposed_imports.is_empty() {
6061
return None;
6162
}
6263

6364
ctx.add_assist_group(AssistId("auto_import"), "auto import", || {
6465
proposed_imports
6566
.into_iter()
66-
.map(|import| import_to_action(import.to_string(), &position, &path_to_import))
67+
.map(|import| import_to_action(import, &position, &path_to_import))
6768
.collect()
6869
})
6970
}

0 commit comments

Comments
 (0)