Function clippy_utils::peel_blocks_with_stmt
source · pub fn peel_blocks_with_stmt<'a>(expr: &'a Expr<'a>) -> &'a Expr<'a>
Expand description
Removes blocks around an expression, only if the block contains just one expression or just one expression statement with a semicolon. Unsafe blocks are not removed.
Examples:
{}
->{}
{ x }
->x
{ x; }
->x
{{ x; }}
->x
{ x; y }
->{ x; y }
{ unsafe { x } }
->unsafe { x }