Skip to content

Commit bde6922

Browse files
committed
fix FutureExt::flatten
1 parent 4430be1 commit bde6922

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ edition = "2018"
1212

1313
[dependencies]
1414
pin-utils = "=0.1.0-alpha.4"
15-
async-trait = "0.1"
15+
async-trait = "0.1.2"
1616

1717
[dependencies.futures]
1818
version = "=0.3.0-alpha.17"

src/future.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ pub trait FutureExt: Future {
2727
new_future.await
2828
}
2929

30-
async fn flatten(self) -> <<Self as Future>::Output as Future>::Output
31-
where <Self as Future>::Output: Future + Send,
30+
async fn flatten(self) -> <Self::Output as Future>::Output
31+
where Self::Output: Future + Send,
3232
Self: Sized,
3333
{
3434
let nested_future = self.await;
@@ -45,8 +45,6 @@ pub trait FutureExt: Future {
4545
}
4646
}
4747

48-
49-
5048
pub async fn and_then<FutA, FutB, F, T, U, E>(future: FutA, f: F) -> Result<U, E>
5149
where F: FnOnce(T) -> FutB,
5250
FutA: Future<Output = Result<T,E>>,

0 commit comments

Comments
 (0)