cargo fmt
Some checks failed
Rust / Test ${{ matrix.build }} (linux-beta, ubuntu-latest, beta) (push) Has been cancelled
Rust / Test ${{ matrix.build }} (linux-nightly, ubuntu-latest, nightly) (push) Has been cancelled
Rust / Test ${{ matrix.build }} (linux-stable, ubuntu-latest, stable) (push) Has been cancelled
Rust / Test ${{ matrix.build }} (macos, macos-latest, stable) (push) Has been cancelled
Rust / Test ${{ matrix.build }} (windows, windows-latest, stable) (push) Has been cancelled

This commit is contained in:
moxian 2025-04-28 21:09:53 -07:00 committed by nora
parent 57fac9d194
commit 060b4afb17

View file

@ -26,9 +26,12 @@ impl VisitMut for Visitor<'_> {
fn visit_block_mut(&mut self, block: &mut syn::Block) {
match block.stmts.as_slice() {
[
syn::Stmt::Expr(syn::Expr::Loop(syn::ExprLoop {
syn::Stmt::Expr(
syn::Expr::Loop(syn::ExprLoop {
body: loop_body, ..
}), _semi),
}),
_semi,
),
] if loop_body.stmts.is_empty() => {}
// Empty bodies are empty already, no need to loopify them.
[] => {}