From d5f43b3a39ec8d5271a393ed7daa31fbcf6bbed0 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Fri, 26 Feb 2021 23:30:55 +0900 Subject: [PATCH] Fix clippy::manual_map warning --- futures-util/src/stream/stream/skip.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/futures-util/src/stream/stream/skip.rs b/futures-util/src/stream/stream/skip.rs index 6ffcf57d77..631ae40ed3 100644 --- a/futures-util/src/stream/stream/skip.rs +++ b/futures-util/src/stream/stream/skip.rs @@ -57,11 +57,8 @@ impl Stream for Skip { fn size_hint(&self) -> (usize, Option) { 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) }