diff --git a/futures-combinators/src/join.rs b/futures-combinators/src/join.rs
index f20637f..597c1a0 100644
--- a/futures-combinators/src/join.rs
+++ b/futures-combinators/src/join.rs
@@ -1,10 +1,8 @@
use futures_core::{ScopedFuture, Wake};
use futures_util::{MaybeDone, MaybeDoneState, maybe_done};
-use std::cell::{Cell, UnsafeCell};
-use std::sync::atomic::Ordering;
-use std::{sync::atomic::AtomicBool, task::Poll};
+use std::{cell::Cell, task::Poll};
-/// from yoshuawuyts/futures-concurrency
+/// from [futures-concurrency](https://github.com/yoshuawuyts/futures-concurrency/tree/main)
/// Wait for all futures to complete.
///
/// Awaits multiple futures simultaneously, returning the output of the futures
@@ -12,59 +10,22 @@ use std::{sync::atomic::AtomicBool, task::Poll};
pub trait Join<'scope> {
/// The resulting output type.
type Output;
+
/// The [`ScopedFuture`] implementation returned by this method.
type Future: ScopedFuture<'scope, Output = Self::Output>;
+
/// Waits for multiple futures to complete.
///
/// Awaits multiple futures simultaneously, returning the output of the futures
/// in the same container type they we're created once all complete.
///
- /// # Examples
- ///
- /// Awaiting multiple futures of the same type can be done using either a vector
- /// or an array.
- /// ```rust
- /// # futures::executor::block_on(async {
- /// use futures_concurrency::prelude::*;
- ///
- /// // all futures passed here are of the same type
- /// let fut1 = core::future::ready(1);
- /// let fut2 = core::future::ready(2);
- /// let fut3 = core::future::ready(3);
- ///
- /// let outputs = [fut1, fut2, fut3].join().await;
- /// assert_eq!(outputs, [1, 2, 3]);
- /// # })
- /// ```
- ///
- /// In practice however, it's common to want to await multiple futures of
- /// different types. For example if you have two different `async {}` blocks,
- /// you want to `.await`. To do that, you can call `.join` on tuples of futures.
- /// ```rust
- /// # futures::executor::block_on(async {
- /// use futures_concurrency::prelude::*;
- ///
- /// async fn some_async_fn() -> usize { 3 }
- ///
- /// // the futures passed here are of different types
- /// let fut1 = core::future::ready(1);
- /// let fut2 = async { 2 };
- /// let fut3 = some_async_fn();
- /// // ^ NOTE: no `.await` here!
- ///
- /// let outputs = (fut1, fut2, fut3).join().await;
- /// assert_eq!(outputs, (1, 2, 3));
- /// # })
- /// ```
- ///
- ///
/// This function returns a new future which polls all futures concurrently.
fn join(self) -> Self::Future;
}
struct WakeStore<'scope> {
parent: Cell