Function wrap_block_expr

Source
fn wrap_block_expr(cx: &ExtCtxt<'_>, expr: P<Expr>) -> P<Expr>
Expand description

Wraps a block expression in parentheses to ensure valid AST in macro expansion output.

If the given expression is a block, it is wrapped in parentheses; otherwise, it is returned unchanged.