From e21f7c4f5d985a9a673baef26a759d280196c2c0 Mon Sep 17 00:00:00 2001 From: quake Date: Wed, 20 Jul 2022 18:48:54 +0900 Subject: [PATCH] fix: optimize_stmt should use fn `position` --- src/optimizer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/optimizer.rs b/src/optimizer.rs index 794cc124..79a02b8a 100644 --- a/src/optimizer.rs +++ b/src/optimizer.rs @@ -745,7 +745,7 @@ fn optimize_stmt(stmt: &mut Stmt, state: &mut OptimizerState, preserve_result: b // Remove all entries after a `true` condition if let Some(n) = list .iter() - .find(|&&index| match case_blocks[index].condition { + .position(|&index| match case_blocks[index].condition { Expr::BoolConstant(true, ..) => true, _ => false, })