fully combin filter and filter_map into single operation

This commit is contained in:
Benjamin Fry 2023-02-27 09:27:55 -08:00
parent 7aaf10078d
commit 24f678cdf5

View File

@ -954,10 +954,14 @@ async fn test_zone_signing() {
assert!(
inner_results
.iter()
.filter(|r| r.record_type() == RecordType::RRSIG)
.filter(|r| r.name() == record.name())
.filter_map(Record::data)
.filter_map(RRSIG::try_borrow)
.filter_map(|r| {
match r.record_type() {
RecordType::RRSIG if r.name() == record.name() => {
r.data().and_then(RRSIG::try_borrow)
}
_ => None,
}
})
.any(|rrsig| rrsig.type_covered() == record.record_type()),
"record type not covered: {:?}",
record