diff options
author | Lukas Wirth <[email protected]> | 2020-09-16 20:29:48 +0100 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2020-09-16 20:36:10 +0100 |
commit | f2ae412ccfa96c4bde42f0b004594c4d6fa54634 (patch) | |
tree | 341754121cca81435e4c7dc51135da6237a3aecb /crates/assists/src/handlers/extract_struct_from_enum_variant.rs | |
parent | 4bc8015370e3698248bc93184ef7ec5fefd2c1d4 (diff) |
Remove make::path_from_text
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 | 7 |
1 files changed, 1 insertions, 6 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 3ea50f375..d1eadaa99 100644 --- a/crates/assists/src/handlers/extract_struct_from_enum_variant.rs +++ b/crates/assists/src/handlers/extract_struct_from_enum_variant.rs | |||
@@ -12,7 +12,6 @@ use syntax::{ | |||
12 | use crate::{ | 12 | use crate::{ |
13 | assist_context::AssistBuilder, utils::insert_use, AssistContext, AssistId, AssistKind, Assists, | 13 | assist_context::AssistBuilder, utils::insert_use, AssistContext, AssistId, AssistKind, Assists, |
14 | }; | 14 | }; |
15 | use ast::make; | ||
16 | use insert_use::ImportScope; | 15 | use insert_use::ImportScope; |
17 | 16 | ||
18 | // Assist: extract_struct_from_enum_variant | 17 | // Assist: extract_struct_from_enum_variant |
@@ -112,11 +111,7 @@ fn insert_import( | |||
112 | let scope = ImportScope::find_insert_use_container(path.syntax(), ctx)?; | 111 | let scope = ImportScope::find_insert_use_container(path.syntax(), ctx)?; |
113 | let syntax = scope.as_syntax_node(); | 112 | let syntax = scope.as_syntax_node(); |
114 | 113 | ||
115 | let new_syntax = insert_use( | 114 | let new_syntax = insert_use(&scope, mod_path.to_ast_path(), ctx.config.insert_use.merge); |
116 | &scope, | ||
117 | make::path_from_text(&mod_path.to_string()), | ||
118 | ctx.config.insert_use.merge, | ||
119 | ); | ||
120 | // FIXME: this will currently panic as multiple imports will have overlapping text ranges | 115 | // FIXME: this will currently panic as multiple imports will have overlapping text ranges |
121 | builder.replace(syntax.text_range(), new_syntax.to_string()) | 116 | builder.replace(syntax.text_range(), new_syntax.to_string()) |
122 | } | 117 | } |