replace_match_with_if_let works on more binary matches

This commit is contained in:
Lukas Wirth 2021-07-02 21:05:10 +02:00
parent f1819525f5
commit 251f0c6090
2 changed files with 141 additions and 24 deletions

View file

@ -49,6 +49,10 @@ impl ast::BlockExpr {
pub fn items(&self) -> AstChildren<ast::Item> {
support::children(self.syntax())
}
pub fn is_empty(&self) -> bool {
self.statements().next().is_none() && self.tail_expr().is_none()
}
}
impl ast::Expr {