Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 277df02

Browse files
committed
This should work, but I got mysterious errors
1 parent 79e5c36 commit 277df02

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

crates/ide-assists/src/handlers/inline_type_alias.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,14 @@ pub(crate) fn inline_type_alias_uses(acc: &mut Assists, ctx: &AssistContext<'_>)
7171
path_type.syntax().ancestors().nth(3).and_then(ast::PathType::cast)
7272
});
7373

74+
path_type_uses.iter().for_each(remove_path_if_in_use_stmt);
7475
for (target, replacement) in path_types.into_iter().filter_map(|path_type| {
7576
let replacement = inline(&ast_alias, &path_type)?.to_text(&concrete_type);
7677
let target = path_type.syntax().text_range();
7778
Some((target, replacement))
7879
}) {
7980
builder.replace(target, replacement);
8081
}
81-
if !path_type_uses.is_empty() {
82-
builder.edit_file(file_id);
83-
path_type_uses.iter().for_each(remove_path_if_in_use_stmt);
84-
}
8582
};
8683

8784
for (file_id, refs) in usages.into_iter() {
@@ -1001,7 +998,6 @@ mod foo;
1001998
1002999
10031000
//- /foo.rs
1004-
10051001
fn foo() {
10061002
let _: i32 = 0;
10071003
}

0 commit comments

Comments
 (0)