aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast/edit.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-04-10 16:07:36 +0100
committerGitHub <[email protected]>2020-04-10 16:07:36 +0100
commitfcd609862b8d5b0567bb74895ef75b02912a375d (patch)
tree4bc012bfc0c2428bc4dee692a1ea2388152a4269 /crates/ra_syntax/src/ast/edit.rs
parent38e0d0f3348900bb4078deb09d48c5b6483d43d6 (diff)
parent5c5bde47fb759440d007c90fd83021de538120b8 (diff)
Merge #3926
3926: Rename some tokens r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/ast/edit.rs')
-rw-r--r--crates/ra_syntax/src/ast/edit.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs
index 3d428fab3..9e5411ee5 100644
--- a/crates/ra_syntax/src/ast/edit.rs
+++ b/crates/ra_syntax/src/ast/edit.rs
@@ -32,9 +32,9 @@ impl ast::FnDef {
32 let mut to_insert: ArrayVec<[SyntaxElement; 2]> = ArrayVec::new(); 32 let mut to_insert: ArrayVec<[SyntaxElement; 2]> = ArrayVec::new();
33 let old_body_or_semi: SyntaxElement = if let Some(old_body) = self.body() { 33 let old_body_or_semi: SyntaxElement = if let Some(old_body) = self.body() {
34 old_body.syntax().clone().into() 34 old_body.syntax().clone().into()
35 } else if let Some(semi) = self.semi_token() { 35 } else if let Some(semi) = self.semicolon_token() {
36 to_insert.push(make::tokens::single_space().into()); 36 to_insert.push(make::tokens::single_space().into());
37 semi.syntax.clone().into() 37 semi.into()
38 } else { 38 } else {
39 to_insert.push(make::tokens::single_space().into()); 39 to_insert.push(make::tokens::single_space().into());
40 to_insert.push(body.syntax().clone().into()); 40 to_insert.push(body.syntax().clone().into());
@@ -98,7 +98,7 @@ impl ast::ItemList {
98 None => match self.l_curly_token() { 98 None => match self.l_curly_token() {
99 Some(it) => ( 99 Some(it) => (
100 " ".to_string() + &leading_indent(self.syntax()).unwrap_or_default(), 100 " ".to_string() + &leading_indent(self.syntax()).unwrap_or_default(),
101 InsertPosition::After(it.syntax().clone().into()), 101 InsertPosition::After(it.into()),
102 ), 102 ),
103 None => return self.clone(), 103 None => return self.clone(),
104 }, 104 },
@@ -142,7 +142,7 @@ impl ast::RecordFieldList {
142 macro_rules! after_l_curly { 142 macro_rules! after_l_curly {
143 () => {{ 143 () => {{
144 let anchor = match self.l_curly_token() { 144 let anchor = match self.l_curly_token() {
145 Some(it) => it.syntax().clone().into(), 145 Some(it) => it.into(),
146 None => return self.clone(), 146 None => return self.clone(),
147 }; 147 };
148 InsertPosition::After(anchor) 148 InsertPosition::After(anchor)
@@ -189,15 +189,15 @@ impl ast::RecordFieldList {
189impl ast::TypeParam { 189impl ast::TypeParam {
190 #[must_use] 190 #[must_use]
191 pub fn remove_bounds(&self) -> ast::TypeParam { 191 pub fn remove_bounds(&self) -> ast::TypeParam {
192 let colon = match self.colon() { 192 let colon = match self.colon_token() {
193 Some(it) => it, 193 Some(it) => it,
194 None => return self.clone(), 194 None => return self.clone(),
195 }; 195 };
196 let end = match self.type_bound_list() { 196 let end = match self.type_bound_list() {
197 Some(it) => it.syntax().clone().into(), 197 Some(it) => it.syntax().clone().into(),
198 None => colon.syntax().clone().into(), 198 None => colon.clone().into(),
199 }; 199 };
200 self.replace_children(colon.syntax().clone().into()..=end, iter::empty()) 200 self.replace_children(colon.into()..=end, iter::empty())
201 } 201 }
202} 202}
203 203