remove useless trait

This commit is contained in:
Aleksey Kladov 2019-09-02 19:45:41 +03:00
parent 4417a97bc5
commit f377b94628
4 changed files with 8 additions and 11 deletions

View file

@ -3134,8 +3134,11 @@ impl AstNode for TryBlockExpr {
&self.syntax
}
}
impl ast::TryBlockBodyOwner for TryBlockExpr {}
impl TryBlockExpr {}
impl TryBlockExpr {
pub fn block(&self) -> Option<Block> {
AstChildren::new(&self.syntax).next()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TryExpr {
pub(crate) syntax: SyntaxNode,

View file

@ -33,12 +33,6 @@ pub trait LoopBodyOwner: AstNode {
}
}
pub trait TryBlockBodyOwner: AstNode {
fn try_body(&self) -> Option<ast::Block> {
child_opt(self)
}
}
pub trait ArgListOwner: AstNode {
fn arg_list(&self) -> Option<ast::ArgList> {
child_opt(self)

View file

@ -426,7 +426,7 @@ Grammar(
traits: ["LoopBodyOwner"],
),
"TryBlockExpr": (
traits: ["TryBlockBodyOwner"],
options: ["Block"],
),
"ForExpr": (
traits: ["LoopBodyOwner"],