diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-19 17:08:17 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-19 17:08:17 +0100 |
commit | f697d27c31ba4486b9711893a93505a05319a2dc (patch) | |
tree | 9c7996d6ac7323da527fb53171b9275545d1640a /crates/ra_assists/src/ast_editor.rs | |
parent | 7bc9dec7cf195bc73a88d7c740f9d0bed1019e98 (diff) | |
parent | 191a6ba330bd47fc3b9cc05d59b2d456b471eb89 (diff) |
Merge #1554
1554: convenience api r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/ast_editor.rs')
-rw-r--r-- | crates/ra_assists/src/ast_editor.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_assists/src/ast_editor.rs b/crates/ra_assists/src/ast_editor.rs index 5fbcadfee..a35334d7e 100644 --- a/crates/ra_assists/src/ast_editor.rs +++ b/crates/ra_assists/src/ast_editor.rs | |||
@@ -299,7 +299,7 @@ mod tokens { | |||
299 | .tree() | 299 | .tree() |
300 | .syntax() | 300 | .syntax() |
301 | .descendants_with_tokens() | 301 | .descendants_with_tokens() |
302 | .filter_map(|it| it.as_token().cloned()) | 302 | .filter_map(|it| it.into_token()) |
303 | .find(|it| it.kind() == T![,]) | 303 | .find(|it| it.kind() == T![,]) |
304 | .unwrap() | 304 | .unwrap() |
305 | } | 305 | } |
@@ -309,7 +309,7 @@ mod tokens { | |||
309 | .tree() | 309 | .tree() |
310 | .syntax() | 310 | .syntax() |
311 | .descendants_with_tokens() | 311 | .descendants_with_tokens() |
312 | .filter_map(|it| it.as_token().cloned()) | 312 | .filter_map(|it| it.into_token()) |
313 | .find(|it| it.kind() == WHITESPACE && it.text().as_str() == " ") | 313 | .find(|it| it.kind() == WHITESPACE && it.text().as_str() == " ") |
314 | .unwrap() | 314 | .unwrap() |
315 | } | 315 | } |
@@ -320,7 +320,7 @@ mod tokens { | |||
320 | .tree() | 320 | .tree() |
321 | .syntax() | 321 | .syntax() |
322 | .descendants_with_tokens() | 322 | .descendants_with_tokens() |
323 | .filter_map(|it| it.as_token().cloned()) | 323 | .filter_map(|it| it.into_token()) |
324 | .find(|it| it.kind() == WHITESPACE && it.text().as_str() == "\n") | 324 | .find(|it| it.kind() == WHITESPACE && it.text().as_str() == "\n") |
325 | .unwrap() | 325 | .unwrap() |
326 | } | 326 | } |
@@ -332,7 +332,7 @@ mod tokens { | |||
332 | WsBuilder(SourceFile::parse(text).ok().unwrap()) | 332 | WsBuilder(SourceFile::parse(text).ok().unwrap()) |
333 | } | 333 | } |
334 | pub(crate) fn ws(&self) -> SyntaxToken { | 334 | pub(crate) fn ws(&self) -> SyntaxToken { |
335 | self.0.syntax().first_child_or_token().unwrap().as_token().cloned().unwrap() | 335 | self.0.syntax().first_child_or_token().unwrap().into_token().unwrap() |
336 | } | 336 | } |
337 | } | 337 | } |
338 | 338 | ||