From e2974ba8f7d862eac084ada2fdf327bbde803bed Mon Sep 17 00:00:00 2001 From: Mikhail Rakhmanov Date: Sat, 23 May 2020 11:57:12 +0200 Subject: Remove unnecessary set_file and change variable positions for better readability --- crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'crates/ra_assists/src/handlers') diff --git a/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs b/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs index d5397bf21..dd2fd57a7 100644 --- a/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs +++ b/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs @@ -127,12 +127,12 @@ fn extract_struct_def( } else { "".to_string() }; - let mut buf = String::new(); let indent = if let Some(indent) = leading_indent(enum_ast) { indent.to_string() } else { "".to_string() }; + let mut buf = String::new(); format_to!( buf, @@ -161,7 +161,6 @@ fn update_variant( list_range.end().checked_sub(TextSize::from(1))?, ); edit.perform(file_id, |builder| { - builder.set_file(file_id); builder.replace(inside_variant_range, variant_name); }); Some(()) -- cgit v1.2.3