Closed
Description
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);