Skip to content

Commit

Permalink
Fix clippy::manual_map warning (#2365)
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e authored Feb 26, 2021
1 parent 0afeda1 commit c03ad8b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions futures-util/src/stream/stream/skip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,8 @@ impl<St: Stream> Stream for Skip<St> {
fn size_hint(&self) -> (usize, Option<usize>) {
let (lower, upper) = self.stream.size_hint();

let lower = lower.saturating_sub(self.remaining as usize);
let upper = match upper {
Some(x) => Some(x.saturating_sub(self.remaining as usize)),
None => None,
};
let lower = lower.saturating_sub(self.remaining);
let upper = upper.map(|x| x.saturating_sub(self.remaining));

(lower, upper)
}
Expand Down

0 comments on commit c03ad8b

Please sign in to comment.