This should work, but I got mysterious errors

This commit is contained in:
ice1000 2022-08-24 05:49:59 +00:00
parent 79e5c366cd
commit 277df02ff5

View file

@ -71,6 +71,7 @@ pub(crate) fn inline_type_alias_uses(acc: &mut Assists, ctx: &AssistContext<'_>)
path_type.syntax().ancestors().nth(3).and_then(ast::PathType::cast)
});
path_type_uses.iter().for_each(remove_path_if_in_use_stmt);
for (target, replacement) in path_types.into_iter().filter_map(|path_type| {
let replacement = inline(&ast_alias, &path_type)?.to_text(&concrete_type);
let target = path_type.syntax().text_range();
@ -78,10 +79,6 @@ pub(crate) fn inline_type_alias_uses(acc: &mut Assists, ctx: &AssistContext<'_>)
}) {
builder.replace(target, replacement);
}
if !path_type_uses.is_empty() {
builder.edit_file(file_id);
path_type_uses.iter().for_each(remove_path_if_in_use_stmt);
}
};
for (file_id, refs) in usages.into_iter() {
@ -1001,7 +998,6 @@ mod foo;
//- /foo.rs
fn foo() {
let _: i32 = 0;
}