diff options
author | Lukas Wirth <[email protected]> | 2021-01-12 14:51:02 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-01-12 14:51:02 +0000 |
commit | 2c1777a2e264e58fccd5ace94b238c8a497ddbda (patch) | |
tree | e7d47c95c6bcdeecd5f321f4ca969d04ca90dff7 /crates/assists/src/handlers/extract_struct_from_enum_variant.rs | |
parent | fbdb32adfc49e0d69b7fd8e44135bea59382d2cb (diff) |
Ensure uniqueness of file ids in reference search via hashmap
Diffstat (limited to 'crates/assists/src/handlers/extract_struct_from_enum_variant.rs')
-rw-r--r-- | crates/assists/src/handlers/extract_struct_from_enum_variant.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/assists/src/handlers/extract_struct_from_enum_variant.rs b/crates/assists/src/handlers/extract_struct_from_enum_variant.rs index 21b13977b..e3ef04932 100644 --- a/crates/assists/src/handlers/extract_struct_from_enum_variant.rs +++ b/crates/assists/src/handlers/extract_struct_from_enum_variant.rs | |||
@@ -8,7 +8,7 @@ use ide_db::{ | |||
8 | insert_use::{insert_use, ImportScope}, | 8 | insert_use::{insert_use, ImportScope}, |
9 | mod_path_to_ast, | 9 | mod_path_to_ast, |
10 | }, | 10 | }, |
11 | search::{FileReference, FileReferences}, | 11 | search::FileReference, |
12 | RootDatabase, | 12 | RootDatabase, |
13 | }; | 13 | }; |
14 | use rustc_hash::FxHashSet; | 14 | use rustc_hash::FxHashSet; |
@@ -63,10 +63,10 @@ pub(crate) fn extract_struct_from_enum_variant( | |||
63 | let current_module = enum_hir.module(ctx.db()); | 63 | let current_module = enum_hir.module(ctx.db()); |
64 | visited_modules_set.insert(current_module); | 64 | visited_modules_set.insert(current_module); |
65 | let mut def_rewriter = None; | 65 | let mut def_rewriter = None; |
66 | for FileReferences { file_id, references: refs } in usages { | 66 | for (file_id, references) in usages { |
67 | let mut rewriter = SyntaxRewriter::default(); | 67 | let mut rewriter = SyntaxRewriter::default(); |
68 | let source_file = ctx.sema.parse(file_id); | 68 | let source_file = ctx.sema.parse(file_id); |
69 | for reference in refs { | 69 | for reference in references { |
70 | update_reference( | 70 | update_reference( |
71 | ctx, | 71 | ctx, |
72 | &mut rewriter, | 72 | &mut rewriter, |