diff options
Diffstat (limited to 'crates/assists/src/handlers')
-rw-r--r-- | crates/assists/src/handlers/extract_struct_from_enum_variant.rs | 9 |
1 files changed, 5 insertions, 4 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 eb812c1c9..80c62d8bb 100644 --- a/crates/assists/src/handlers/extract_struct_from_enum_variant.rs +++ b/crates/assists/src/handlers/extract_struct_from_enum_variant.rs | |||
@@ -97,6 +97,7 @@ fn existing_struct_def(db: &RootDatabase, variant_name: &str, variant: &EnumVari | |||
97 | .any(|(name, _)| name.to_string() == variant_name.to_string()) | 97 | .any(|(name, _)| name.to_string() == variant_name.to_string()) |
98 | } | 98 | } |
99 | 99 | ||
100 | #[allow(dead_code)] | ||
100 | fn insert_import( | 101 | fn insert_import( |
101 | ctx: &AssistContext, | 102 | ctx: &AssistContext, |
102 | builder: &mut AssistBuilder, | 103 | builder: &mut AssistBuilder, |
@@ -174,9 +175,9 @@ fn update_reference( | |||
174 | builder: &mut AssistBuilder, | 175 | builder: &mut AssistBuilder, |
175 | reference: Reference, | 176 | reference: Reference, |
176 | source_file: &SourceFile, | 177 | source_file: &SourceFile, |
177 | enum_module_def: &ModuleDef, | 178 | _enum_module_def: &ModuleDef, |
178 | variant_hir_name: &Name, | 179 | _variant_hir_name: &Name, |
179 | visited_modules_set: &mut FxHashSet<Module>, | 180 | _visited_modules_set: &mut FxHashSet<Module>, |
180 | ) -> Option<()> { | 181 | ) -> Option<()> { |
181 | let path_expr: ast::PathExpr = find_node_at_offset::<ast::PathExpr>( | 182 | let path_expr: ast::PathExpr = find_node_at_offset::<ast::PathExpr>( |
182 | source_file.syntax(), | 183 | source_file.syntax(), |
@@ -185,7 +186,7 @@ fn update_reference( | |||
185 | let call = path_expr.syntax().parent().and_then(ast::CallExpr::cast)?; | 186 | let call = path_expr.syntax().parent().and_then(ast::CallExpr::cast)?; |
186 | let list = call.arg_list()?; | 187 | let list = call.arg_list()?; |
187 | let segment = path_expr.path()?.segment()?; | 188 | let segment = path_expr.path()?.segment()?; |
188 | let module = ctx.sema.scope(&path_expr.syntax()).module()?; | 189 | let _module = ctx.sema.scope(&path_expr.syntax()).module()?; |
189 | let list_range = list.syntax().text_range(); | 190 | let list_range = list.syntax().text_range(); |
190 | let inside_list_range = TextRange::new( | 191 | let inside_list_range = TextRange::new( |
191 | list_range.start().checked_add(TextSize::from(1))?, | 192 | list_range.start().checked_add(TextSize::from(1))?, |