From 0a4f30aa69ad9ee9386948a927bd889ae84d1e79 Mon Sep 17 00:00:00 2001 From: Lilith River Date: Wed, 30 Oct 2024 05:46:08 -0600 Subject: [PATCH] Print the number of bytes fetched after a file is successfully downloaded. --- imageflow_core/tests/common/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/imageflow_core/tests/common/mod.rs b/imageflow_core/tests/common/mod.rs index 0fb4e9b7..ce28c962 100644 --- a/imageflow_core/tests/common/mod.rs +++ b/imageflow_core/tests/common/mod.rs @@ -289,9 +289,13 @@ impl ChecksumCtx{ if dest_path.exists() { println!("{} (trusted) exists", checksum); }else{ - println!("Fetching {} to {:?}", &source_url, &dest_path); + print!("Fetching {} to {:?}...", &source_url, &dest_path); let bytes = ::imageflow_http_helpers::fetch_bytes(&source_url).expect("Did you forget to upload {} to s3?"); - File::create(&dest_path).unwrap().write_all(bytes.as_ref()).unwrap(); + let mut f = File::create(&dest_path).unwrap(); + f.write_all(bytes.as_ref()).unwrap(); + f.flush().unwrap(); + + println!("{} bytes written successfully.", bytes.len()); } }