Skip to content

Commit c058f9a

Browse files
committed
Turn combinators into async trait methods
1 parent 80ac73f commit c058f9a

File tree

3 files changed

+404
-380
lines changed

3 files changed

+404
-380
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ maintenance = { status = "experimental" }
1919

2020
[dependencies]
2121
pin-utils = "=0.1.0-alpha.4"
22+
async-trait = "0.1.3"
2223

2324
[dependencies.futures]
2425
version = "=0.3.0-alpha.18"

examples/future.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use futures_async_combinators::future::*;
44
fn main() {
55
executor::block_on(async {
66
let future = ready(Ok::<i32, i32>(1));
7-
let future = and_then(future, |x| ready(Ok::<i32, i32>(x + 3)));
8-
let future = inspect(future, |x| {
7+
let future = future.and_then(|x| ready(Ok::<i32, i32>(x + 3)));
8+
let future = future.inspect(|x| {
99
dbg!(x);
1010
});
1111
assert_eq!(future.await, Ok(4));

0 commit comments

Comments
 (0)