Skip to content
This repository has been archived by the owner on Sep 24, 2022. It is now read-only.

Commit

Permalink
replace copied wit filter_map for rustc 1.35 compatibility (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
dunnock authored and alexcrichton committed Nov 1, 2019
1 parent 4673cfd commit 1e6bfbc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/de.rs
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1e6bfbc

Please sign in to comment.