- // extract the first expression (if any) from the block
- let inner_expr = extract_first_expr(block);
- let (extracted, collect_expr) = match inner_stmt_expr {
- Some(_) => (inner_stmt_expr, true), // check if an expression exists in the first statement
- None => (inner_expr, false), // if not, let's go for the first expression in the block
- };
-
- if let Some(inner) = extracted {
+ // or extract the first expression (if any) from the block
+ if let Some(inner) = inner_stmt_expr.or_else(|| extract_first_expr(block)) {