Remove AsyncOwner
This commit is contained in:
@@ -221,6 +221,10 @@ impl ast::FnDef {
|
||||
.and_then(|it| it.into_token())
|
||||
.filter(|it| it.kind() == T![;])
|
||||
}
|
||||
|
||||
pub fn is_async(&self) -> bool {
|
||||
self.syntax().children_with_tokens().any(|it| it.kind() == T![async])
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::LetStmt {
|
||||
|
||||
@@ -1129,7 +1129,6 @@ impl ast::NameOwner for FnDef {}
|
||||
impl ast::TypeParamsOwner for FnDef {}
|
||||
impl ast::AttrsOwner for FnDef {}
|
||||
impl ast::DocCommentsOwner for FnDef {}
|
||||
impl ast::AsyncOwner for FnDef {}
|
||||
impl FnDef {
|
||||
pub fn param_list(&self) -> Option<ParamList> {
|
||||
AstChildren::new(&self.syntax).next()
|
||||
|
||||
@@ -8,7 +8,6 @@ use crate::{
|
||||
ast::{self, child_opt, children, AstChildren, AstNode, AstToken},
|
||||
match_ast,
|
||||
syntax_node::{SyntaxElementChildren, SyntaxNodeChildren},
|
||||
SyntaxKind,
|
||||
};
|
||||
|
||||
pub trait TypeAscriptionOwner: AstNode {
|
||||
@@ -106,12 +105,6 @@ pub trait AttrsOwner: AstNode {
|
||||
}
|
||||
}
|
||||
|
||||
pub trait AsyncOwner: AstNode {
|
||||
fn is_async(&self) -> bool {
|
||||
self.syntax().children_with_tokens().any(|t| t.kind() == SyntaxKind::ASYNC_KW)
|
||||
}
|
||||
}
|
||||
|
||||
pub trait DocCommentsOwner: AstNode {
|
||||
fn doc_comments(&self) -> CommentIter {
|
||||
CommentIter { iter: self.syntax().children_with_tokens() }
|
||||
|
||||
@@ -275,8 +275,7 @@ Grammar(
|
||||
"NameOwner",
|
||||
"TypeParamsOwner",
|
||||
"AttrsOwner",
|
||||
"DocCommentsOwner",
|
||||
"AsyncOwner"
|
||||
"DocCommentsOwner"
|
||||
],
|
||||
options: [ "ParamList", ["body", "BlockExpr"], "RetType" ],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user