Created
July 8, 2017 09:51
-
-
Save MindFlavor/921be836536151076b3fdab9f8b68975 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![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