From e981716f47936ea31aa4d262fd01816749f094b1 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sat, 20 Feb 2021 17:10:36 +0900 Subject: [PATCH] Fix clippy::manual_flatten warning (#2347) --- futures-util/src/future/future/shared.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/futures-util/src/future/future/shared.rs b/futures-util/src/future/future/shared.rs index 5e6c88f194..74311a02c0 100644 --- a/futures-util/src/future/future/shared.rs +++ b/futures-util/src/future/future/shared.rs @@ -313,10 +313,8 @@ where // Wake all tasks and drop the slab let mut wakers_guard = inner.notifier.wakers.lock().unwrap(); let mut wakers = wakers_guard.take().unwrap(); - for opt_waker in wakers.drain() { - if let Some(waker) = opt_waker { - waker.wake(); - } + for waker in wakers.drain().flatten() { + waker.wake(); } drop(_reset); // Make borrow checker happy