internal: remove deprecated method
This commit is contained in:
parent
9c74a5b2c0
commit
d5c5b7cd12
@ -253,7 +253,10 @@ fn pick_pattern_and_expr_order(
|
|||||||
|
|
||||||
fn is_empty_expr(expr: &ast::Expr) -> bool {
|
fn is_empty_expr(expr: &ast::Expr) -> bool {
|
||||||
match expr {
|
match expr {
|
||||||
ast::Expr::BlockExpr(expr) => expr.is_empty(),
|
ast::Expr::BlockExpr(expr) => match expr.stmt_list() {
|
||||||
|
Some(it) => it.statements().next().is_none() && it.tail_expr().is_none(),
|
||||||
|
None => true,
|
||||||
|
},
|
||||||
ast::Expr::TupleExpr(expr) => expr.fields().next().is_none(),
|
ast::Expr::TupleExpr(expr) => expr.fields().next().is_none(),
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
|
@ -58,9 +58,6 @@ pub fn items(&self) -> impl Iterator<Item = ast::Item> {
|
|||||||
self.stmt_list().into_iter().flat_map(|it| it.items())
|
self.stmt_list().into_iter().flat_map(|it| it.items())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_empty(&self) -> bool {
|
|
||||||
self.statements().next().is_none() && self.tail_expr().is_none()
|
|
||||||
}
|
|
||||||
pub fn statements(&self) -> impl Iterator<Item = ast::Stmt> {
|
pub fn statements(&self) -> impl Iterator<Item = ast::Stmt> {
|
||||||
self.stmt_list().into_iter().flat_map(|it| it.statements())
|
self.stmt_list().into_iter().flat_map(|it| it.statements())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user