Skip to content

Commit e2974ba

Browse files
committed
Remove unnecessary set_file and change variable positions for better readability
1 parent 3a244e0 commit e2974ba

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ fn extract_struct_def(
127127
} else {
128128
"".to_string()
129129
};
130-
let mut buf = String::new();
131130
let indent = if let Some(indent) = leading_indent(enum_ast) {
132131
indent.to_string()
133132
} else {
134133
"".to_string()
135134
};
135+
let mut buf = String::new();
136136

137137
format_to!(
138138
buf,
@@ -161,7 +161,6 @@ fn update_variant(
161161
list_range.end().checked_sub(TextSize::from(1))?,
162162
);
163163
edit.perform(file_id, |builder| {
164-
builder.set_file(file_id);
165164
builder.replace(inside_variant_range, variant_name);
166165
});
167166
Some(())

0 commit comments

Comments
 (0)