diff options
author | Edwin Cheng <[email protected]> | 2019-12-24 16:25:18 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2019-12-24 16:25:18 +0000 |
commit | 208ad97fdc9427f1243ac170c1c25f9f7d6ae964 (patch) | |
tree | def2b978483f772d095394404ba9c5cf7404e4b5 /crates/ra_syntax/src/ast | |
parent | 42813126d92cc1fb145e75752b5a95d884ea9a12 (diff) |
Remove AsyncOwner
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r-- | crates/ra_syntax/src/ast/extensions.rs | 4 | ||||
-rw-r--r-- | crates/ra_syntax/src/ast/generated.rs | 1 | ||||
-rw-r--r-- | crates/ra_syntax/src/ast/traits.rs | 7 |
3 files changed, 4 insertions, 8 deletions
diff --git a/crates/ra_syntax/src/ast/extensions.rs b/crates/ra_syntax/src/ast/extensions.rs index a8f625176..baaef3023 100644 --- a/crates/ra_syntax/src/ast/extensions.rs +++ b/crates/ra_syntax/src/ast/extensions.rs | |||
@@ -221,6 +221,10 @@ impl ast::FnDef { | |||
221 | .and_then(|it| it.into_token()) | 221 | .and_then(|it| it.into_token()) |
222 | .filter(|it| it.kind() == T![;]) | 222 | .filter(|it| it.kind() == T![;]) |
223 | } | 223 | } |
224 | |||
225 | pub fn is_async(&self) -> bool { | ||
226 | self.syntax().children_with_tokens().any(|it| it.kind() == T![async]) | ||
227 | } | ||
224 | } | 228 | } |
225 | 229 | ||
226 | impl ast::LetStmt { | 230 | impl ast::LetStmt { |
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 73e1c407c..9f9d6e63c 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs | |||
@@ -1129,7 +1129,6 @@ impl ast::NameOwner for FnDef {} | |||
1129 | impl ast::TypeParamsOwner for FnDef {} | 1129 | impl ast::TypeParamsOwner for FnDef {} |
1130 | impl ast::AttrsOwner for FnDef {} | 1130 | impl ast::AttrsOwner for FnDef {} |
1131 | impl ast::DocCommentsOwner for FnDef {} | 1131 | impl ast::DocCommentsOwner for FnDef {} |
1132 | impl ast::AsyncOwner for FnDef {} | ||
1133 | impl FnDef { | 1132 | impl FnDef { |
1134 | pub fn param_list(&self) -> Option<ParamList> { | 1133 | pub fn param_list(&self) -> Option<ParamList> { |
1135 | AstChildren::new(&self.syntax).next() | 1134 | AstChildren::new(&self.syntax).next() |
diff --git a/crates/ra_syntax/src/ast/traits.rs b/crates/ra_syntax/src/ast/traits.rs index 8bf6aa2f0..f99984fe0 100644 --- a/crates/ra_syntax/src/ast/traits.rs +++ b/crates/ra_syntax/src/ast/traits.rs | |||
@@ -8,7 +8,6 @@ use crate::{ | |||
8 | ast::{self, child_opt, children, AstChildren, AstNode, AstToken}, | 8 | ast::{self, child_opt, children, AstChildren, AstNode, AstToken}, |
9 | match_ast, | 9 | match_ast, |
10 | syntax_node::{SyntaxElementChildren, SyntaxNodeChildren}, | 10 | syntax_node::{SyntaxElementChildren, SyntaxNodeChildren}, |
11 | SyntaxKind, | ||
12 | }; | 11 | }; |
13 | 12 | ||
14 | pub trait TypeAscriptionOwner: AstNode { | 13 | pub trait TypeAscriptionOwner: AstNode { |
@@ -106,12 +105,6 @@ pub trait AttrsOwner: AstNode { | |||
106 | } | 105 | } |
107 | } | 106 | } |
108 | 107 | ||
109 | pub trait AsyncOwner: AstNode { | ||
110 | fn is_async(&self) -> bool { | ||
111 | self.syntax().children_with_tokens().any(|t| t.kind() == SyntaxKind::ASYNC_KW) | ||
112 | } | ||
113 | } | ||
114 | |||
115 | pub trait DocCommentsOwner: AstNode { | 108 | pub trait DocCommentsOwner: AstNode { |
116 | fn doc_comments(&self) -> CommentIter { | 109 | fn doc_comments(&self) -> CommentIter { |
117 | CommentIter { iter: self.syntax().children_with_tokens() } | 110 | CommentIter { iter: self.syntax().children_with_tokens() } |