-
-
Save koivunej/cbcaae52b7242a73419ef62e4c606bd7 to your computer and use it in GitHub Desktop.
Minified diffs for async-trait 0.1.42 => 0.1.43 expansions
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
fn list<'life0, 'async_trait>( | |
&'life0 self, | |
) -> ::core::pin::Pin< | |
Box< | |
dyn ::core::future::Future<Output = Result<Vec<Cid>, Error>> | |
+ ::core::marker::Send | |
+ 'async_trait, | |
>, | |
> | |
where | |
'life0: 'async_trait, | |
Self: 'async_trait, | |
{ | |
async fn __list(__self: &FsBlockStore) -> Result<Vec<Cid>, Error> { | |
use futures::future::{ready, Either}; | |
use futures::stream::{empty, TryStreamExt}; | |
use tokio_stream::wrappers::ReadDirStream; | |
async move { | |
let stream = ReadDirStream::new(fs::read_dir(__self.path.clone()).await?); | |
let vec = stream | |
.and_then(|d| async move { | |
Ok(if d.file_type().await?.is_dir() { | |
Either::Left(ReadDirStream::new(fs::read_dir(d.path()).await?)) | |
} else { | |
Either::Right(empty()) | |
}) | |
}) | |
.try_flatten() | |
.try_filter_map(|d| { | |
let name = d.file_name(); | |
let path: &std::path::Path = name.as_ref(); | |
ready(if path.extension() != Some("data".as_ref()) { | |
Ok(None) | |
} else { | |
let maybe_cid = filestem_to_block_cid(path.file_stem()); | |
Ok(maybe_cid) | |
}) | |
}) | |
.try_collect::<Vec<_>>() | |
.await?; | |
Ok(vec) | |
} | |
.await | |
} | |
Box::pin(__list(self)) | |
} |
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
fn list<'life0, 'async_trait>( | |
&'life0 self, | |
) -> ::core::pin::Pin< | |
Box< | |
dyn ::core::future::Future<Output = Result<Vec<Cid>, Error>> | |
+ ::core::marker::Send | |
+ 'async_trait, | |
>, | |
> | |
where | |
'life0: 'async_trait, | |
Self: 'async_trait, | |
{ | |
Box::pin(async move { | |
let __ret: Result<Vec<Cid>, Error> = { | |
let __self = self; | |
use futures::future::{ready, Either}; | |
use futures::stream::{empty, TryStreamExt}; | |
use tokio_stream::wrappers::ReadDirStream; | |
async move { | |
let stream = ReadDirStream::new(fs::read_dir(__self.path.clone()).await?); | |
let vec = stream | |
.and_then(|d| async move { | |
Ok(if d.file_type().await?.is_dir() { | |
Either::Left(ReadDirStream::new(fs::read_dir(d.path()).await?)) | |
} else { | |
Either::Right(empty()) | |
}) | |
}) | |
.try_flatten() | |
.try_filter_map(|d| { | |
let name = d.file_name(); | |
let path: &std::path::Path = name.as_ref(); | |
ready(if path.extension() != Some("data".as_ref()) { | |
Ok(None) | |
} else { | |
let maybe_cid = filestem_to_block_cid(path.file_stem()); | |
Ok(maybe_cid) | |
}) | |
}) | |
.try_collect::<Vec<_>>() | |
.await?; | |
Ok(vec) | |
} | |
.await | |
}; | |
#[allow(unreachable_code)] | |
__ret | |
}) | |
} |
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
--- 42.rs 2021-08-03 11:06:52.549242298 +0300 | |
+++ 43.rs 2021-08-03 11:04:59.500732483 +0300 | |
@@ -11,7 +11,9 @@ | |
'life0: 'async_trait, | |
Self: 'async_trait, | |
{ | |
- async fn __list(__self: &FsBlockStore) -> Result<Vec<Cid>, Error> { | |
+ Box::pin(async move { | |
+ let __ret: Result<Vec<Cid>, Error> = { | |
+ let __self = self; | |
use futures::future::{ready, Either}; | |
use futures::stream::{empty, TryStreamExt}; | |
use tokio_stream::wrappers::ReadDirStream; | |
@@ -41,6 +43,8 @@ | |
Ok(vec) | |
} | |
.await | |
- } | |
- Box::pin(__list(self)) | |
+ }; | |
+ #[allow(unreachable_code)] | |
+ __ret | |
+ }) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment