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::flatten #404

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

Comments

@yoshuawuyts
Copy link
Member

@yoshuawuyts yoshuawuyts commented Oct 28, 2019

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);
@portgasd666

This comment has been minimized.

Copy link
Contributor

@portgasd666 portgasd666 commented Oct 31, 2019

I can take a stab at this

@skade

This comment has been minimized.

Copy link
Collaborator

@skade skade commented Oct 31, 2019

@portgasd666 go ahead!

@k-nasa

This comment has been minimized.

Copy link
Member

@k-nasa k-nasa commented Nov 11, 2019

This seems to have been resolved! by #443

@k-nasa k-nasa closed this Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.