From 5d99ba1d9a5acf02a5cd50e456f164bd80b523b5 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Thu, 4 Feb 2021 20:49:24 +0100 Subject: Make `ModPath`'s representation private --- crates/assists/src/handlers/extract_struct_from_enum_variant.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/assists') 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 e3ef04932..5c7678b53 100644 --- a/crates/assists/src/handlers/extract_struct_from_enum_variant.rs +++ b/crates/assists/src/handlers/extract_struct_from_enum_variant.rs @@ -151,8 +151,8 @@ fn insert_import( ctx.config.insert_use.prefix_kind, ); if let Some(mut mod_path) = mod_path { - mod_path.segments.pop(); - mod_path.segments.push(variant_hir_name.clone()); + mod_path.pop_segment(); + mod_path.push_segment(variant_hir_name.clone()); let scope = ImportScope::find_insert_use_container(scope_node, &ctx.sema)?; *rewriter += insert_use(&scope, mod_path_to_ast(&mod_path), ctx.config.insert_use.merge); } -- cgit v1.2.3