diff --git a/futures-util/src/stream/mapped_futures/mod.rs b/futures-util/src/stream/mapped_futures/mod.rs index dfb37a756..4df4a95c9 100644 --- a/futures-util/src/stream/mapped_futures/mod.rs +++ b/futures-util/src/stream/mapped_futures/mod.rs @@ -166,7 +166,8 @@ impl MappedFutures { // if let Some(task) = self.hash_set.get(key) { if let Some(task) = self.set().take(key) { unsafe { - if let Some(_) = (*task.future.get()).take() { + if (*task.future.get()).is_some() { + task.future.get().write(None); self.inner.unlink(Arc::as_ptr(&task.inner)); return true; }