Skip to content

Instantly share code, notes, and snippets.

@MindFlavor
Created July 8, 2017 09:51
Show Gist options
  • Save MindFlavor/921be836536151076b3fdab9f8b68975 to your computer and use it in GitHub Desktop.
Save MindFlavor/921be836536151076b3fdab9f8b68975 to your computer and use it in GitHub Desktop.
#![feature(conservative_impl_trait)]
extern crate futures;
use futures::future::*;
struct ErrorA;
struct ErrorB;
fn fut_a() -> impl Future<Item = (), Error = ErrorA> {
ok(())
}
fn fut_b() -> impl Future<Item = (), Error = ErrorB> {
ok(())
}
fn main() {
let future = fut_a().and_then(|_| fut_b());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment