Skip to content

Instantly share code, notes, and snippets.

@sinkuu
Last active April 5, 2018 09:13
Show Gist options
  • Save sinkuu/7d9e6dcf6397546866f367b281562c30 to your computer and use it in GitHub Desktop.
Save sinkuu/7d9e6dcf6397546866f367b281562c30 to your computer and use it in GitHub Desktop.
[package]
name = "foo"
version = "0.1.0"
[dependencies]
futures = "0.1"
extern crate futures;
use futures::{future, Future};
fn foo() -> impl Future<Item = (), Error = ()> + Send {
future::join_all(vec![0].into_iter().map(|_| bar())).and_then(|_: Vec<_>| Ok(()))
}
fn bar() -> Box<Future<Item = (), Error = ()> + Send> {
unimplemented!()
}
fn main() {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment