Skip to content

Add Future::flatten #404

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

Closed
yoshuawuyts opened this issue Oct 28, 2019 · 3 comments
Closed

Add Future::flatten #404

yoshuawuyts opened this issue Oct 28, 2019 · 3 comments
Labels
api design Open design questions enhancement New feature or request good first issue Good for newcomers

Comments

@yoshuawuyts
Copy link
Contributor

Similar to future-rs's Future::flatten method, this can sometimes come in useful.

However the only difference with it should be that we take IntoFuture as the trait bound, and call it under the hood. Because IntoFuture is implemented for Future this should work as expected.

Thanks!

Examples

let nested_future = async { async { 1 } };
let future = nested_future.flatten();
assert_eq!(future.await, 1);
@yoshuawuyts yoshuawuyts added enhancement New feature or request api design Open design questions good first issue Good for newcomers labels Oct 28, 2019
@abhishekc-sharma
Copy link
Contributor

I can take a stab at this

@skade
Copy link
Collaborator

skade commented Oct 31, 2019

@portgasd666 go ahead!

@k-nasa
Copy link
Member

k-nasa commented Nov 11, 2019

This seems to have been resolved! by #443

@k-nasa k-nasa closed this as completed Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api design Open design questions enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants