diff --git a/src/stream/stream/max_by_key.rs b/src/stream/stream/max_by_key.rs index 5ebc25d..e421f94 100644 --- a/src/stream/stream/max_by_key.rs +++ b/src/stream/stream/max_by_key.rs @@ -59,10 +59,7 @@ where } Poll::Pending } - None => Poll::Ready(match this.max.take() { - None => None, - Some(max) => Some(max.1), - }), + None => Poll::Ready(this.max.take().map(|max| max.1)), } } } diff --git a/src/stream/stream/min_by_key.rs b/src/stream/stream/min_by_key.rs index 3cd0014..142dfe1 100644 --- a/src/stream/stream/min_by_key.rs +++ b/src/stream/stream/min_by_key.rs @@ -59,10 +59,7 @@ where } Poll::Pending } - None => Poll::Ready(match this.min.take() { - None => None, - Some(max) => Some(max.1), - }), + None => Poll::Ready(this.min.take().map(|min| min.1)), } } }