Skip to content

Commit d5c5b7c

Browse files
committed
internal: remove deprecated method
1 parent 9c74a5b commit d5c5b7c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crates/ide_assists/src/handlers/replace_if_let_with_match.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,10 @@ fn pick_pattern_and_expr_order(
253253

254254
fn is_empty_expr(expr: &ast::Expr) -> bool {
255255
match expr {
256-
ast::Expr::BlockExpr(expr) => expr.is_empty(),
256+
ast::Expr::BlockExpr(expr) => match expr.stmt_list() {
257+
Some(it) => it.statements().next().is_none() && it.tail_expr().is_none(),
258+
None => true,
259+
},
257260
ast::Expr::TupleExpr(expr) => expr.fields().next().is_none(),
258261
_ => false,
259262
}

crates/syntax/src/ast/node_ext.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ impl ast::BlockExpr {
5858
self.stmt_list().into_iter().flat_map(|it| it.items())
5959
}
6060

61-
pub fn is_empty(&self) -> bool {
62-
self.statements().next().is_none() && self.tail_expr().is_none()
63-
}
6461
pub fn statements(&self) -> impl Iterator<Item = ast::Stmt> {
6562
self.stmt_list().into_iter().flat_map(|it| it.statements())
6663
}

0 commit comments

Comments
 (0)