diff --git a/src/future/future/join.rs b/src/future/future/join.rs index 5cfbd99a..0febcad0 100644 --- a/src/future/future/join.rs +++ b/src/future/future/join.rs @@ -12,7 +12,7 @@ pin_project! { pub struct Join where L: Future, - R: Future + R: Future, { #[pin] left: MaybeDone, #[pin] right: MaybeDone, @@ -22,7 +22,7 @@ pin_project! { impl Join where L: Future, - R: Future, + R: Future, { pub(crate) fn new(left: L, right: R) -> Self { Self { @@ -35,7 +35,7 @@ where impl Future for Join where L: Future, - R: Future, + R: Future, { type Output = (L::Output, R::Output); diff --git a/src/future/future/mod.rs b/src/future/future/mod.rs index 5fdaf4b1..0f9ef586 100644 --- a/src/future/future/mod.rs +++ b/src/future/future/mod.rs @@ -289,10 +289,10 @@ extension_trait! { use async_std::future; let a = future::ready(1u8); - let b = future::ready(2u8); + let b = future::ready(2u16); let f = a.join(b); - assert_eq!(f.await, (1u8, 2u8)); + assert_eq!(f.await, (1u8, 2u16)); # }); ``` "#] @@ -304,7 +304,7 @@ extension_trait! { ) -> impl Future::Output, ::Output)> [Join] where Self: std::future::Future + Sized, - F: std::future::Future::Output>, + F: std::future::Future, { Join::new(self, other) } @@ -328,30 +328,30 @@ extension_trait! { use async_std::prelude::*; use async_std::future; - let a = future::ready(Err("Error")); + let a = future::ready(Err::("Error")); let b = future::ready(Ok(1u8)); let f = a.try_join(b); assert_eq!(f.await, Err("Error")); let a = future::ready(Ok::(1u8)); - let b = future::ready(Ok::(2u8)); + let b = future::ready(Ok::(2u16)); let f = a.try_join(b); - assert_eq!(f.await, Ok((1u8, 2u8))); + assert_eq!(f.await, Ok((1u8, 2u16))); # # Ok(()) }) } ``` "#] #[cfg(any(feature = "unstable", feature = "docs"))] #[cfg_attr(feature = "docs", doc(cfg(unstable)))] - fn try_join( + fn try_join( self, other: F - ) -> impl Future> [TryJoin] + ) -> impl Future> [TryJoin] where - Self: std::future::Future> + Sized, - F: std::future::Future::Output>, + Self: std::future::Future> + Sized, + F: std::future::Future>, { TryJoin::new(self, other) } diff --git a/src/future/future/try_join.rs b/src/future/future/try_join.rs index 58ae6d62..f1667240 100644 --- a/src/future/future/try_join.rs +++ b/src/future/future/try_join.rs @@ -12,7 +12,7 @@ pin_project! { pub struct TryJoin where L: Future, - R: Future + R: Future, { #[pin] left: MaybeDone, #[pin] right: MaybeDone, @@ -22,7 +22,7 @@ pin_project! { impl TryJoin where L: Future, - R: Future, + R: Future, { pub(crate) fn new(left: L, right: R) -> Self { Self { @@ -32,12 +32,12 @@ where } } -impl Future for TryJoin +impl Future for TryJoin where - L: Future>, - R: Future, + L: Future>, + R: Future>, { - type Output = Result<(T, T), E>; + type Output = Result<(A, B), E>; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let this = self.project();