mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
cleanup editor
This commit is contained in:
parent
05ca252fb5
commit
4acadbdca6
2 changed files with 11 additions and 5 deletions
|
@ -187,6 +187,7 @@ impl ast::RecordFieldList {
|
|||
}
|
||||
|
||||
impl ast::TypeParam {
|
||||
#[must_use]
|
||||
pub fn remove_bounds(&self) -> ast::TypeParam {
|
||||
let colon = match self.colon_token() {
|
||||
Some(it) => it,
|
||||
|
@ -200,7 +201,8 @@ impl ast::TypeParam {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn strip_attrs_and_docs<N: ast::AttrsOwner>(node: N) -> N {
|
||||
#[must_use]
|
||||
pub fn strip_attrs_and_docs<N: ast::AttrsOwner>(node: &N) -> N {
|
||||
N::cast(strip_attrs_and_docs_inner(node.syntax().clone())).unwrap()
|
||||
}
|
||||
|
||||
|
@ -217,6 +219,7 @@ fn strip_attrs_and_docs_inner(mut node: SyntaxNode) -> SyntaxNode {
|
|||
node
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn replace_descendants<N: AstNode, D: AstNode>(
|
||||
parent: &N,
|
||||
replacement_map: impl Iterator<Item = (D, D)>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue