diff options
Diffstat (limited to 'crates/ra_assists')
-rw-r--r-- | crates/ra_assists/src/assists/auto_import.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_assists/src/assists/auto_import.rs b/crates/ra_assists/src/assists/auto_import.rs index 295fdf2e2..4c3793ac7 100644 --- a/crates/ra_assists/src/assists/auto_import.rs +++ b/crates/ra_assists/src/assists/auto_import.rs | |||
@@ -55,7 +55,8 @@ pub(crate) fn auto_import<F: ImportsLocator>( | |||
55 | .filter_map(|module_def| module_with_name_to_import.find_use_path(ctx.db, module_def)) | 55 | .filter_map(|module_def| module_with_name_to_import.find_use_path(ctx.db, module_def)) |
56 | .filter(|use_path| !use_path.segments.is_empty()) | 56 | .filter(|use_path| !use_path.segments.is_empty()) |
57 | .take(20) | 57 | .take(20) |
58 | .collect::<std::collections::HashSet<_>>(); | 58 | .map(|import| import.to_string()) |
59 | .collect::<std::collections::BTreeSet<_>>(); | ||
59 | if proposed_imports.is_empty() { | 60 | if proposed_imports.is_empty() { |
60 | return None; | 61 | return None; |
61 | } | 62 | } |
@@ -63,7 +64,7 @@ pub(crate) fn auto_import<F: ImportsLocator>( | |||
63 | ctx.add_assist_group(AssistId("auto_import"), "auto import", || { | 64 | ctx.add_assist_group(AssistId("auto_import"), "auto import", || { |
64 | proposed_imports | 65 | proposed_imports |
65 | .into_iter() | 66 | .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)) |
67 | .collect() | 68 | .collect() |
68 | }) | 69 | }) |
69 | } | 70 | } |