diff --git a/src/evaluation/policy_eval.rs b/src/evaluation/policy_eval.rs index 4f6144cb..b8939e0c 100644 --- a/src/evaluation/policy_eval.rs +++ b/src/evaluation/policy_eval.rs @@ -192,8 +192,8 @@ fn has_immediate_win(policy_features: &PolicyFeatures) -> bool { policy_features.move_onto_critical_square[1], policy_features.spread_that_connects_groups_to_win[0], ] - .iter() - .any(|p| *p != 0.0) + .into_iter() + .any(|p| p != 0.0) } struct MovementSynopsis { diff --git a/src/position/mod.rs b/src/position/mod.rs index ca725064..fd865b7b 100644 --- a/src/position/mod.rs +++ b/src/position/mod.rs @@ -763,7 +763,7 @@ impl Position { for square in square::squares_iterator::() { group_data.amount_in_group[group_data.groups[square] as usize].0 += 1; - if self[square].top_stone().map(Piece::is_road_piece) == Some(true) { + if self[square].top_stone().is_some_and(Piece::is_road_piece) { group_data.amount_in_group[group_data.groups[square] as usize].1 = group_data.amount_in_group[group_data.groups[square] as usize].1 | square.group_edge_connection();