Check and unwrap() Option instead of .iter().for_each() (#21072)
This commit is contained in:
parent
91c49d7023
commit
1453fce6c6
|
@ -1150,12 +1150,14 @@ mod with_incremental_snapshots {
|
|||
cluster_info: &ClusterInfo,
|
||||
validator_config: &ValidatorConfig,
|
||||
) -> HashMap<(Slot, Hash), HashSet<(Slot, Hash)>> {
|
||||
if validator_config.trusted_validators.is_none() {
|
||||
trace!("no trusted validators, so no trusted snapshot hashes");
|
||||
return HashMap::new();
|
||||
}
|
||||
let trusted_validators = validator_config.trusted_validators.as_ref().unwrap();
|
||||
|
||||
let mut trusted_snapshot_hashes: HashMap<(Slot, Hash), HashSet<(Slot, Hash)>> =
|
||||
HashMap::new();
|
||||
validator_config
|
||||
.trusted_validators
|
||||
.iter()
|
||||
.for_each(|trusted_validators| {
|
||||
trusted_validators
|
||||
.iter()
|
||||
.for_each(|trusted_validator| {
|
||||
|
@ -1197,7 +1199,6 @@ mod with_incremental_snapshots {
|
|||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
trace!("trusted snapshot hashes: {:?}", &trusted_snapshot_hashes);
|
||||
|
|
Loading…
Reference in New Issue