fix(concurrency): fix await places

This commit is contained in:
2025-07-25 21:35:12 +02:00
parent 02ad79a93c
commit f70afbf7c0

View File

@@ -25,12 +25,10 @@ async fn main() -> std::io::Result<()> {
panic!("Not enough arguments");
}
let filename: String = argv.nth(1).unwrap();
let buf = File::open(&filename)
.await
.expect("Failed to open input file.");
let buf = File::open(&filename);
magick_rust::magick_wand_genesis();
let buf = BufReader::new(buf).compat();
let buf = BufReader::new(buf.await.expect("Failed to open input file")).compat();
let mut zip = ZipFileReader::new(buf)
.await
.expect("Failed to decompress input file.");
@@ -42,13 +40,12 @@ async fn main() -> std::io::Result<()> {
for i in 0..zip.file().entries().len() {
let file = zip.file().entries().get(i).unwrap().clone();
let filename = file.filename();
let mut entry = zip
.reader_with_entry(i)
.await
.expect("Failed to get zip individual file.");
let entry = zip.reader_with_entry(i);
let mut buf = vec![];
let n = entry
.await
.expect("Failed to get zip individual file.")
.read_to_end_checked(&mut buf)
.await
.expect("Failed to read the zip individual file.");