mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Move remove_bounds to edit.rs
This commit is contained in:
parent
0f654b06ab
commit
85f5cbc9dc
3 changed files with 16 additions and 22 deletions
|
@ -189,6 +189,21 @@ impl ast::RecordFieldList {
|
|||
}
|
||||
}
|
||||
|
||||
impl ast::TypeAliasDef {
|
||||
#[must_use]
|
||||
pub fn remove_bounds(&self) -> ast::TypeAliasDef {
|
||||
let colon = match self.colon_token() {
|
||||
Some(it) => it,
|
||||
None => return self.clone(),
|
||||
};
|
||||
let end = match self.type_bound_list() {
|
||||
Some(it) => it.syntax().clone().into(),
|
||||
None => colon.clone().into(),
|
||||
};
|
||||
self.replace_children(colon.into()..=end, iter::empty())
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::TypeParam {
|
||||
#[must_use]
|
||||
pub fn remove_bounds(&self) -> ast::TypeParam {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue