From 0c529187a9c17625762a47ed02f23e119a5a56ad Mon Sep 17 00:00:00 2001 From: Boris-Chengbiao Zhou Date: Thu, 2 Mar 2017 03:11:49 +0100 Subject: [PATCH] Output progress --- src/main.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index a45dd59..33b34d7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -125,7 +125,8 @@ fn download_catalog(catalog_name: &str, out_dir: &Path, auth: &str) { println!("Starting to download {} presentations!", presentations.len()); - for presentation in presentations { + for (i, presentation) in presentations.iter().enumerate() { + println!("Downloading {}/{}: {}", i + 1, presentations.len(), presentation.name); download_presentation(&presentation, out_dir, auth); } } @@ -150,8 +151,6 @@ fn get_catalog_id(name: &str, auth: &str) -> String { } fn download_presentation(presentation: &Presentation, out_dir: &Path, auth: &str) { - println!("Downloading: {}", presentation.name); - let response = CLIENT.get(&presentation.download_url) .header(construct_cookie(auth)) .send()