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

Commit

Permalink
Use more obvious closure notation
Browse files Browse the repository at this point in the history
  • Loading branch information
est31 committed Oct 28, 2019
1 parent 9a38a82 commit 158498c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/de.rs
Expand Up @@ -400,9 +400,7 @@ impl<'de, 'b> de::MapAccess<'de> for MapVisitor<'de, 'b> {
self.table_pindices
.get(&prefix_stripped)
.and_then(|entries| {
let start = entries
.binary_search(&self.cur)
.unwrap_or_else(std::convert::identity);
let start = entries.binary_search(&self.cur).unwrap_or_else(|v| v);
if start == entries.len() || entries[start] < self.cur {
return None;
}
Expand Down Expand Up @@ -541,9 +539,7 @@ impl<'de, 'b> de::SeqAccess<'de> for MapVisitor<'de, 'b> {
.table_indices
.get(&header_stripped)
.and_then(|entries| {
let start = entries
.binary_search(&start_idx)
.unwrap_or_else(std::convert::identity);
let start = entries.binary_search(&start_idx).unwrap_or_else(|v| v);
if start == entries.len() || entries[start] < start_idx {
return None;
}
Expand Down

0 comments on commit 158498c

Please sign in to comment.