master
Avril 4 years ago
parent 6b07786a32
commit 7a1228e025
Signed by: flanchan
GPG Key ID: 966FE03CC0E0B199

2
Cargo.lock generated

@ -579,7 +579,7 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
[[package]] [[package]]
name = "sever" name = "sever"
version = "1.0.0" version = "1.0.1"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"color-eyre", "color-eyre",

@ -1,7 +1,7 @@
[package] [package]
name = "sever" name = "sever"
description = "Coerce hardlinks into new files" description = "Coerce hardlinks into new files"
version = "1.0.0" version = "1.0.1"
authors = ["Avril <flanchan@cumallover.me>"] authors = ["Avril <flanchan@cumallover.me>"]
edition = "2018" edition = "2018"
readme = "README.org" readme = "README.org"

@ -71,7 +71,7 @@ async fn main() -> eyre::Result<()> {
.dedup()) .dedup())
.filter_map(|file| { .filter_map(|file| {
async move { async move {
Some(parallel::expand_dir(file).await) Some(parallel::expand_dir(file).await) //TODO: We gotta in here, too
} }
}).flatten()).await, }).flatten()).await,
"Jobs failed") "Jobs failed")

@ -98,7 +98,7 @@ async fn join_stream<I: Stream>(stream: I) -> impl Iterator<Item=<I::Item as Fut
where I::Item: Future where I::Item: Future
{ {
//gotta be a better way than heap allocating here, right? //gotta be a better way than heap allocating here, right?
stream.then(|x| async move { x.await }).collect::<Vec<_>>().await.into_iter() join_all(stream.collect::<Vec<_>>().await.into_iter()).await.into_iter() //TODO: We need to de-dupe this
} }
pub async fn main<I: Stream<Item=String>>(list: I) -> eyre::Result<()> pub async fn main<I: Stream<Item=String>>(list: I) -> eyre::Result<()>
@ -213,7 +213,7 @@ pub async fn expand_dir(p: String) -> impl Stream<Item=String>
tx.send(p).await.unwrap(); tx.send(p).await.unwrap();
} }
}); });
rx rx //TODO: map this to dedup
} else { } else {
stream::iter(iter::once(p).filter_map(|p| { stream::iter(iter::once(p).filter_map(|p| {
if Path::new(&p).is_dir() { if Path::new(&p).is_dir() {

Loading…
Cancel
Save