SHARE
TWEET

Untitled

a guest May 22nd, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use futures::Stream;
  2.  
  3. fn main() -> Result<(), Box<std::error::Error>> {
  4.     let matches = Box::new(clap::App::new("foo")
  5.         .arg(clap::Arg::with_name("FILE").multiple(true).required(true))
  6.         .get_matches_from(vec!["foo", "a", "b", "c"]));
  7.     let matches = Box::leak(matches);
  8.  
  9.     let files = matches.values_of("FILE").unwrap();
  10.  
  11.     let stream = futures::stream::iter_ok::<_, ()>(files)
  12.         .for_each(|x| {
  13.             println!("x: {}", x);
  14.             futures::future::ok(())
  15.         });
  16.        
  17.     tokio::run(stream);
  18.  
  19.     Ok(())
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top