clippy didnt like my code

main
Zynh0722 2023-04-09 00:04:07 -07:00
parent 807334f29b
commit cae9e20a57
1 changed files with 1 additions and 11 deletions

View File

@ -163,7 +163,6 @@ where
let writer = writer.clone(); let writer = writer.clone();
let path = entry.path(); let path = entry.path();
// This feels terribly wrong
spawn_blocking(move || { spawn_blocking(move || {
let mut file = std::fs::File::open(path).unwrap(); let mut file = std::fs::File::open(path).unwrap();
let mut writer = writer.lock().unwrap(); let mut writer = writer.lock().unwrap();
@ -177,21 +176,12 @@ where
}) })
.collect(); .collect();
// let out: Vec<u64> = join_all(zip_handles)
// .await
// .iter()
// .map(|v| { v.unwrap().join() })
// .collect();
join_all(zip_handles) join_all(zip_handles)
.await .await
.iter() .iter()
.map(|v| { .map(|v| v.as_ref().unwrap().as_ref().unwrap())
v.as_ref().unwrap().as_ref().unwrap()
})
.for_each(|bytes| tracing::debug!("bytes written {bytes}")); .for_each(|bytes| tracing::debug!("bytes written {bytes}"));
writer.lock().unwrap().finish()?; writer.lock().unwrap().finish()?;
Ok(()) Ok(())