Skip to content

Commit

Permalink
chore: Impl IntoFuture to collect all the blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusc93 committed Sep 29, 2024
1 parent 45781c9 commit b29b457
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/repo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,18 @@ impl Stream for RepoGetBlocks {
}
}

impl IntoFuture for RepoGetBlocks {
type Output = Result<Vec<Block>, Error>;
type IntoFuture = BoxFuture<'static, Self::Output>;
fn into_future(self) -> Self::IntoFuture {
async move {
let col = self.try_collect().await?;
Ok(col)
}
.boxed()
}
}

pub struct RepoPutBlock<'a> {
repo: Repo,
block: &'a Block,
Expand Down

0 comments on commit b29b457

Please sign in to comment.