Skip to content

Commit

Permalink
works
Browse files Browse the repository at this point in the history
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
  • Loading branch information
yoshuawuyts committed Oct 28, 2019
1 parent 85f5cd7 commit ad69d85
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions src/future/future/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,13 @@ extension_trait! {
"#]
#[cfg(any(feature = "unstable", feature = "docs"))]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
fn select<F>(self, other: F) ->
impl Future<Output = Self::Output> [Select<Self, F>]
fn select<F>(
self,
other: F
) -> impl Future<Output = <Self as std::future::Future>::Output> [Select<Self, F>]
where
Self: Sized + Future,
F: std::future::Future<Output = <Self as Future>::Output>,
Self: std::future::Future + Sized,
F: std::future::Future<Output = <Self as std::future::Future>::Output>,
{
Select::new(self, other)
}
Expand Down Expand Up @@ -178,12 +180,13 @@ extension_trait! {
"#]
#[cfg(any(feature = "unstable", feature = "docs"))]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
fn try_select<F, T, E>(self, other: F) ->
impl Future<Output = Self::Output> [TrySelect<Self, F>]
fn try_select<F: std::future::Future, T, E>(
self,
other: F
) -> impl Future<Output = <Self as std::future::Future>::Output> [TrySelect<Self, F>]
where
Self: Sized,
Self: Future<Output = Result<T, E>>,
F: Future<Output = Self::Output>,
Self: std::future::Future<Output = Result<T, E>> + Sized,
F: std::future::Future<Output = <Self as std::future::Future>::Output>,
{
TrySelect::new(self, other)
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ macro_rules! extension_trait {
};

// Parse the return type in an extension method.
(@doc ($($head:tt)*) -> impl Future<Output = $out:ty> [$f:ty] $($tail:tt)*) => {
(@doc ($($head:tt)*) -> impl Future<Output = $out:ty> $(+ $lt:lifetime)? [$f:ty] $($tail:tt)*) => {
extension_trait!(@doc ($($head)* -> owned::ImplFuture<$out>) $($tail)*);
};
(@ext ($($head:tt)*) -> impl Future<Output = $out:ty> $(+ $lt:lifetime)? [$f:ty] $($tail:tt)*) => {
Expand Down

0 comments on commit ad69d85

Please sign in to comment.