Remove unnecessary set_file and change variable positions for better readability

This commit is contained in:
Mikhail Rakhmanov 2020-05-23 11:57:12 +02:00
parent 3a244e02b5
commit e2974ba8f7

View File

@ -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(())