diff --git a/Cargo.lock b/Cargo.lock index fb825d4..a690cef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1063,13 +1063,12 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.17.2" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4295cbb7573c16d310e99e713cf9e75101eb190ab31fccd35f2d2691b4352b19" +checksum = "fcc42b206e70d86ec03285b123e65a5458c92027d1fb2ae3555878b8113b3ddf" dependencies = [ "console", "number_prefix", - "portable-atomic", "unicode-width", ] @@ -1415,12 +1414,6 @@ dependencies = [ "universal-hash", ] -[[package]] -name = "portable-atomic" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15eb2c6e362923af47e13c23ca5afb859e83d54452c55b0b9ac763b8f7c1ac16" - [[package]] name = "ppv-lite86" version = "0.2.17" diff --git a/Cargo.toml b/Cargo.toml index 3b9925c..8278590 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -78,7 +78,7 @@ merge = "0.1" serde_with = "2.1" rpassword = "7" bytesize = "1" -indicatif = "0.17" +indicatif = "=0.17.0" # until https://github.com/console-rs/indicatif/issues/493 is fixed. path-dedot = "3" gethostname = "0.4" humantime = "2" diff --git a/src/commands/helpers.rs b/src/commands/helpers.rs index d70b9a8..d3cb536 100644 --- a/src/commands/helpers.rs +++ b/src/commands/helpers.rs @@ -85,8 +85,7 @@ pub fn progress_bytes(prefix: impl Into>) -> ProgressBar { ProgressStyle::default_bar() .with_key("my_eta", |s: &ProgressState, w: &mut dyn Write| match (s.pos(), s.len()){ - (0, _) => write!(w,"-"), - (pos,Some(len)) => write!(w,"{:#}", HumanDuration(Duration::from_secs(s.elapsed().as_secs() * (len-pos)/pos))), + (pos,Some(len)) if pos != 0 => write!(w,"{:#}", HumanDuration(Duration::from_secs(s.elapsed().as_secs() * (len-pos)/pos))), (_, _) => write!(w,"-"), }.unwrap()) .template("[{elapsed_precise}] {prefix:30} {bar:40.cyan/blue} {bytes:>10}/{total_bytes:10} {bytes_per_sec:12} (ETA {my_eta})")