diff --git a/src/logic/future_moves.rs b/src/logic/future_moves.rs index 07a3cd9..f368da7 100644 --- a/src/logic/future_moves.rs +++ b/src/logic/future_moves.rs @@ -250,10 +250,9 @@ impl FutureMoves { .arena .iter() .enumerate() - .find(|(_, m)| { - &m.board == board && (m.parent == self.current_root) && self.current_root.is_some() - }) - .map(|(idx, _)| idx); + .find(|(_, m)| &m.board == board && (m.parent == self.current_root)) + .map(|(idx, _)| idx) + .filter(|_| self.current_root.is_some()); if let Some(curr_board_idx) = curr_board { self.set_root_idx_raw(curr_board_idx);