We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd417fe commit 251a3a9Copy full SHA for 251a3a9
src/formatting/expr.rs
@@ -1206,18 +1206,10 @@ pub(crate) fn is_simple_block_stmt(
1206
}
1207
1208
fn block_has_statements(block: &ast::Block) -> bool {
1209
- block.stmts.iter().any(|stmt| match stmt.kind {
1210
- ast::StmtKind::Semi(ref expr) => {
1211
- if let ast::ExprKind::Tup(ref tup_exprs) = expr.kind {
1212
- if tup_exprs.is_empty() {
1213
- return false;
1214
- }
1215
1216
- true
1217
1218
- ast::StmtKind::Empty => false,
1219
- _ => true,
1220
- })
+ !block
+ .stmts
+ .iter()
+ .all(|stmt| matches!(stmt.kind, ast::StmtKind::Empty))
1221
1222
1223
/// Checks whether a block contains no statements, expressions, comments, or
0 commit comments