item deleter pass

This commit is contained in:
nora 2023-01-22 13:19:18 +01:00
parent 22804c3065
commit fdfde615f6
8 changed files with 162 additions and 5 deletions

View file

@ -28,6 +28,8 @@ impl VisitMut for Visitor<'_> {
[syn::Stmt::Expr(syn::Expr::Loop(syn::ExprLoop {
body: loop_body, ..
}))] if loop_body.stmts.is_empty() => {}
// Empty bodies are empty already, no need to loopify them.
[] => {}
_ if self.checker.can_process(&self.current_path) => {
*block = self.loop_expr.clone();
self.process_state = ProcessState::Changed;