Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add future::try_select #1622

Merged
merged 2 commits into from
May 20, 2019
Merged

Add future::try_select #1622

merged 2 commits into from
May 20, 2019

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented May 19, 2019

The same as 0.1's select2.

@Matthias247
Copy link
Contributor

Is there any situation you would prefer this over select!?
I would actually try to encourage people to really go the idiomatic async/await way, and not to offer multiple ways to do the same thing (that all need to be maintained).

@taiki-e taiki-e force-pushed the future-try_select branch from 46aea70 to 649c0e2 Compare May 20, 2019 06:33
@taiki-e
Copy link
Member Author

taiki-e commented May 20, 2019

TrySelect is TryFuture but Select is not.

@taiki-e taiki-e force-pushed the future-try_select branch from 649c0e2 to fa63a54 Compare May 20, 2019 07:00
impl<A: Unpin, B: Unpin> Future for TrySelect<A, B>
where A: TryFuture, B: TryFuture
{
#[allow(clippy::type_complexity)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol-- no kidding

@cramertj
Copy link
Member

seems basically fine to me, and could help people move over code directly without going all the way to async/await. It is unfortunate to have all of these "multiple ways to do things" but after all that's sort of why futures-util exists.

@cramertj cramertj merged commit 6bb6881 into rust-lang:master May 20, 2019
@taiki-e taiki-e deleted the future-try_select branch May 20, 2019 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants