fn flatten(self) -> Flatten<Self>
    where
        Self::Output: Future,
        Self: Sized,
    {
        let f = Flatten::new(self);
        assert_future::<<<Self as Future>::Output as Future>::Output, _>(f)
    }
Flatten the execution of this future when the output of this
future is itself another future.

This can be useful when combining futures together to flatten the
computation out the final result.

This method is roughly equivalent to `self.then(|x| x)`.

Note that this function consumes the receiving future and returns a
wrapped version of it.

# Examples

```
# futures::executor::block_on(async {
use futures::future::FutureExt;

let nested_future = async { async { 1 } };
let future = nested_future.flatten();
assert_eq!(future.await, 1);
# });
```
futures-util/src/future/future/mod.rs