From 1e6bfbca98813d7126b65ba6e6706237dc9a3274 Mon Sep 17 00:00:00 2001 From: Maxim Vorobjov Date: Fri, 1 Nov 2019 17:58:09 +0300 Subject: replace copied wit filter_map for rustc 1.35 compatibility (#354) --- src/de.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/de.rs b/src/de.rs index 27462e8..ae44f20 100644 --- a/src/de.rs +++ b/src/de.rs @@ -432,8 +432,7 @@ impl<'de, 'b> de::MapAccess<'de> for MapVisitor<'de, 'b> { } entries[start..] .iter() - .copied() - .filter(|i| *i < self.max) + .filter_map(|i| if *i < self.max { Some(*i) } else { None }) .map(|i| (i, &self.tables[i])) .find(|(_, table)| table.values.is_some()) .map(|p| p.0) @@ -572,8 +571,7 @@ impl<'de, 'b> de::SeqAccess<'de> for MapVisitor<'de, 'b> { } entries[start..] .iter() - .copied() - .filter(|i| *i < self.max) + .filter_map(|i| if *i < self.max { Some(*i) } else { None }) .map(|i| (i, &self.tables[i])) .find(|(_, table)| table.array) .map(|p| p.0) -- cgit v1.2.3