Unnamed repository; edit this file 'description' to name the repository.
remove clone_for_update from iniline_type_alias
bit-aloo 7 weeks ago
parent 8f093fb · commit 43af140
-rw-r--r--crates/ide-assists/src/handlers/inline_type_alias.rs19
1 files changed, 8 insertions, 11 deletions
diff --git a/crates/ide-assists/src/handlers/inline_type_alias.rs b/crates/ide-assists/src/handlers/inline_type_alias.rs
index f3ebe61078..f5b5b228f3 100644
--- a/crates/ide-assists/src/handlers/inline_type_alias.rs
+++ b/crates/ide-assists/src/handlers/inline_type_alias.rs
@@ -170,7 +170,7 @@ impl Replacement {
Replacement::Generic { lifetime_map, const_and_type_map } => {
create_replacement(lifetime_map, const_and_type_map, concrete_type)
}
- Replacement::Plain => concrete_type.syntax().clone_subtree().clone_for_update(),
+ Replacement::Plain => concrete_type.syntax().clone(),
}
}
}
@@ -361,7 +361,7 @@ fn create_replacement(
continue;
}
- replacements.push((syntax.clone(), new_lifetime.syntax().clone_for_update()));
+ replacements.push((syntax.clone(), new_lifetime.syntax().clone()));
}
} 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 {
@@ -449,15 +449,12 @@ impl ConstOrTypeGeneric {
}
fn replacement_value(&self) -> Option<SyntaxNode> {
- Some(
- match self {
- ConstOrTypeGeneric::ConstArg(ca) => ca.expr()?.syntax().clone(),
- ConstOrTypeGeneric::TypeArg(ta) => ta.syntax().clone(),
- ConstOrTypeGeneric::ConstParam(cp) => cp.default_val()?.syntax().clone(),
- ConstOrTypeGeneric::TypeParam(tp) => tp.default_type()?.syntax().clone(),
- }
- .clone_for_update(),
- )
+ Some(match self {
+ ConstOrTypeGeneric::ConstArg(ca) => ca.expr()?.syntax().clone(),
+ ConstOrTypeGeneric::TypeArg(ta) => ta.syntax().clone(),
+ ConstOrTypeGeneric::ConstParam(cp) => cp.default_val()?.syntax().clone(),
+ ConstOrTypeGeneric::TypeParam(tp) => tp.default_type()?.syntax().clone(),
+ })
}
}