This commit is contained in:
nora 2022-12-18 11:27:23 +01:00
parent a36bf95c3e
commit 1cb5114557
7 changed files with 226 additions and 69 deletions

View file

@ -27,11 +27,12 @@ impl VisitMut for Visitor<'_> {
match block.stmts.as_slice() {
[syn::Stmt::Expr(syn::Expr::Loop(syn::ExprLoop {
body: loop_body, ..
}))] if loop_body.stmts.is_empty() && self.checker.can_process(&self.current_path) => {}
_ => {
}))] if loop_body.stmts.is_empty() => {}
_ if self.checker.can_process(&self.current_path) => {
*block = self.loop_expr.clone();
self.process_state = ProcessState::Changed;
}
_ => {}
}
}