From 110aedc051dd4beac66bc0e953607b004309d619 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Thu, 14 Jun 2018 18:01:49 +0200 Subject: [PATCH] Fix regression due to pending stabilization of Iterator::flatten --- src/summary.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/summary.rs b/src/summary.rs index d38f086..e96b4a0 100644 --- a/src/summary.rs +++ b/src/summary.rs @@ -110,7 +110,8 @@ fn alerts(responses: &[&Response]) -> Vec { // TODO: &[&T] is totally weird fn check_soa_serial_numbers(responses: &[&Response]) -> Option { let mut serial_counts = HashMap::new(); - responses + Itertools::flatten( + responses .iter() .map(|r| r.answers .iter() @@ -119,12 +120,12 @@ fn check_soa_serial_numbers(responses: &[&Response]) -> Option { _ => None }) ) - .flatten() - .filter_map(|x| x) - .for_each(|key| { - let value = serial_counts.entry(key).or_insert(0); - *value += 1; - }); + ) + .filter_map(|x| x) + .for_each(|key| { + let value = serial_counts.entry(key).or_insert(0); + *value += 1; + }); if serial_counts.len() > 1 { Some(Alert::SoaSnDiverge(serial_counts))