Unnamed repository; edit this file 'description' to name the repository.
refactor: conpare text of name_ref instead of syntax name_ref
Hmikihiro 9 months ago
parent b770720 · commit feaf647
-rw-r--r--crates/ide-assists/src/handlers/inline_type_alias.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ide-assists/src/handlers/inline_type_alias.rs b/crates/ide-assists/src/handlers/inline_type_alias.rs
index 4511072b04..f667d62593 100644
--- a/crates/ide-assists/src/handlers/inline_type_alias.rs
+++ b/crates/ide-assists/src/handlers/inline_type_alias.rs
@@ -322,7 +322,10 @@ fn create_replacement(
replacements.push((syntax.clone(), new_lifetime.syntax().clone_for_update()));
}
- } else if let Some(replacement_syntax) = const_and_type_map.0.get(syntax_str) {
+ } else if let Some(name_ref) = ast::NameRef::cast(syntax.clone()) {
+ let Some(replacement_syntax) = const_and_type_map.0.get(&name_ref.to_string()) else {
+ continue;
+ };
let new_string = replacement_syntax.to_string();
let new = if new_string == "_" {
make::wildcard_pat().syntax().clone_for_update()