Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use futures::Stream;
- fn main() -> Result<(), Box<std::error::Error>> {
- let matches = Box::new(clap::App::new("foo")
- .arg(clap::Arg::with_name("FILE").multiple(true).required(true))
- .get_matches_from(vec!["foo", "a", "b", "c"]));
- let matches = Box::leak(matches);
- let files = matches.values_of("FILE").unwrap();
- let stream = futures::stream::iter_ok::<_, ()>(files)
- .for_each(|x| {
- println!("x: {}", x);
- futures::future::ok(())
- });
- tokio::run(stream);
- Ok(())
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement