Some tests involving futures-rs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
480B

  1. extern crate futures;
  2. extern crate tokio_core;
  3. use futures::future::{self};
  4. use futures::future::*;
  5. use tokio_core::reactor::Core;
  6. fn main() {
  7. let mut core = Core::new().expect("Failed to initialize tokio_core reactor!");
  8. let f = future::result(Ok(()))
  9. .map_err(|()| "&'static str error")
  10. .and_then(|_|
  11. future::result(Ok(())
  12. .map_err(|()| "String error".to_owned())
  13. )
  14. )
  15. ;
  16. core.run(f).unwrap();
  17. }