chore: remove wrong logic code

This commit is contained in:
Yuki.N 2025-03-28 08:13:59 +08:00
parent 3a82332bea
commit ce2f638c32

View file

@ -150,13 +150,10 @@ async fn download_image(client: Client, url: &str, dir: &Path, pb: &ProgressBar)
.create(true)
.open(&temp_path)?;
let mut downloaded_size = 0;
let mut stream = response.bytes_stream();
while let Some(chunk) = stream.next().await {
let chunk = chunk?;
file.write_all(&chunk)?;
downloaded_size += chunk.len() as u64;
pb.set_length(downloaded_size);
pb.inc(chunk.len() as u64);
}