diff --git a/eth2/types/src/beacon_state/slot_processing.rs b/eth2/types/src/beacon_state/slot_processing.rs index ab5311d21..9501083f0 100644 --- a/eth2/types/src/beacon_state/slot_processing.rs +++ b/eth2/types/src/beacon_state/slot_processing.rs @@ -47,8 +47,9 @@ impl BeaconState { let mut result = None; for slot in self.get_current_epoch_boundaries(spec.epoch_length) { for (committee, shard) in self.get_crosslink_committees_at_slot(slot, spec)? { - if let Some(committee_index) = committee.iter().find(|i| **i == validator_index) { - result = Some(Ok((slot, shard, *committee_index as u64))); + if let Some(committee_index) = committee.iter().position(|&i| i == validator_index) + { + result = Some(Ok((slot, shard, committee_index as u64))); } } }