aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src
diff options
context:
space:
mode:
authorMikhail Rakhmanov <[email protected]>2020-05-23 10:57:12 +0100
committerMikhail Rakhmanov <[email protected]>2020-05-23 10:57:12 +0100
commite2974ba8f7d862eac084ada2fdf327bbde803bed (patch)
treea863ddf69307ce02d1528d5856163217402951fc /crates/ra_assists/src
parent3a244e02b53687161d4cc39254cb9a432756017f (diff)
Remove unnecessary set_file and change variable positions for better readability
Diffstat (limited to 'crates/ra_assists/src')
-rw-r--r--crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs3
1 files changed, 1 insertions, 2 deletions
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(
127 } else { 127 } else {
128 "".to_string() 128 "".to_string()
129 }; 129 };
130 let mut buf = String::new();
131 let indent = if let Some(indent) = leading_indent(enum_ast) { 130 let indent = if let Some(indent) = leading_indent(enum_ast) {
132 indent.to_string() 131 indent.to_string()
133 } else { 132 } else {
134 "".to_string() 133 "".to_string()
135 }; 134 };
135 let mut buf = String::new();
136 136
137 format_to!( 137 format_to!(
138 buf, 138 buf,
@@ -161,7 +161,6 @@ fn update_variant(
161 list_range.end().checked_sub(TextSize::from(1))?, 161 list_range.end().checked_sub(TextSize::from(1))?,
162 ); 162 );
163 edit.perform(file_id, |builder| { 163 edit.perform(file_id, |builder| {
164 builder.set_file(file_id);
165 builder.replace(inside_variant_range, variant_name); 164 builder.replace(inside_variant_range, variant_name);
166 }); 165 });
167 Some(()) 166 Some(())