aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-09-30 08:08:28 +0100
committerAleksey Kladov <[email protected]>2019-09-30 08:08:28 +0100
commit4acadbdca61e77368061a0c53125e164912ab5d5 (patch)
treeb0272446dd887cbfab9168e2a0379de1c6f10a6d /crates/ra_syntax
parent05ca252fb51bbbf60433bdd3af55ce14bbd66bfd (diff)
cleanup editor
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r--crates/ra_syntax/src/ast/edit.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs
index d0857d88b..03f3b5fbb 100644
--- a/crates/ra_syntax/src/ast/edit.rs
+++ b/crates/ra_syntax/src/ast/edit.rs
@@ -187,6 +187,7 @@ impl ast::RecordFieldList {
187} 187}
188 188
189impl ast::TypeParam { 189impl ast::TypeParam {
190 #[must_use]
190 pub fn remove_bounds(&self) -> ast::TypeParam { 191 pub fn remove_bounds(&self) -> ast::TypeParam {
191 let colon = match self.colon_token() { 192 let colon = match self.colon_token() {
192 Some(it) => it, 193 Some(it) => it,
@@ -200,7 +201,8 @@ impl ast::TypeParam {
200 } 201 }
201} 202}
202 203
203pub fn strip_attrs_and_docs<N: ast::AttrsOwner>(node: N) -> N { 204#[must_use]
205pub fn strip_attrs_and_docs<N: ast::AttrsOwner>(node: &N) -> N {
204 N::cast(strip_attrs_and_docs_inner(node.syntax().clone())).unwrap() 206 N::cast(strip_attrs_and_docs_inner(node.syntax().clone())).unwrap()
205} 207}
206 208
@@ -217,6 +219,7 @@ fn strip_attrs_and_docs_inner(mut node: SyntaxNode) -> SyntaxNode {
217 node 219 node
218} 220}
219 221
222#[must_use]
220pub fn replace_descendants<N: AstNode, D: AstNode>( 223pub fn replace_descendants<N: AstNode, D: AstNode>(
221 parent: &N, 224 parent: &N,
222 replacement_map: impl Iterator<Item = (D, D)>, 225 replacement_map: impl Iterator<Item = (D, D)>,