replace copied wit filter_map for rustc 1.35 compatibility (#354)

This commit is contained in:
Maxim Vorobjov 2019-11-01 17:58:09 +03:00 committed by Alex Crichton
parent e22c19436c
commit 9e3cd1d431

View file

@ -432,8 +432,7 @@ impl<'de, 'b> de::MapAccess<'de> for MapVisitor<'de, 'b> {
} }
entries[start..] entries[start..]
.iter() .iter()
.copied() .filter_map(|i| if *i < self.max { Some(*i) } else { None })
.filter(|i| *i < self.max)
.map(|i| (i, &self.tables[i])) .map(|i| (i, &self.tables[i]))
.find(|(_, table)| table.values.is_some()) .find(|(_, table)| table.values.is_some())
.map(|p| p.0) .map(|p| p.0)
@ -572,8 +571,7 @@ impl<'de, 'b> de::SeqAccess<'de> for MapVisitor<'de, 'b> {
} }
entries[start..] entries[start..]
.iter() .iter()
.copied() .filter_map(|i| if *i < self.max { Some(*i) } else { None })
.filter(|i| *i < self.max)
.map(|i| (i, &self.tables[i])) .map(|i| (i, &self.tables[i]))
.find(|(_, table)| table.array) .find(|(_, table)| table.array)
.map(|p| p.0) .map(|p| p.0)