From a903140eb1213486deafd3bd96458c95155ae365 Mon Sep 17 00:00:00 2001 From: MrSnowy Date: Sat, 28 Jun 2025 17:40:00 +0200 Subject: [PATCH] update --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/lib.rs | 17 +++++++++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a820a7..834f1dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,4 +4,4 @@ version = 4 [[package]] name = "snowy_libs" -version = "0.1.0" +version = "0.1.1" diff --git a/Cargo.toml b/Cargo.toml index 1a4a4a0..b826308 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snowy_libs" -version = "0.1.0" +version = "0.1.1" edition = "2024" [dependencies] diff --git a/src/lib.rs b/src/lib.rs index 9b4d501..ca31bac 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -61,7 +61,13 @@ pub fn start_progress_bar( let remaining_time = (still_todo / time_per_percentage).ceil(); if done == total { - string.push_str(&format!(" {}/{} {}% || done! \n", done, total, procentage)); + string.push_str(&format!( + " {}/{} {}% || in {}s! \n", + done, + total, + procentage, + going_for.round() + )); } else { string.push_str(&format!( " {}/{} {}% || {}s ", @@ -96,7 +102,14 @@ mod tests { let value = Arc::new(AtomicU64::from(0)); - start_progress_bar(&value, 100, 50, "Being silly", now, Duration::from_secs(1)); + start_progress_bar( + &value, + 100, + 50, + "Being silly", + now, + Duration::from_millis(1), + ); for _ in 0..=100 { value.fetch_add(1, Ordering::Relaxed); -- 2.51.2