Skip to content

Commit 507d7e4

Browse files
committed
fix: remove total bytes received from progress message
1 parent 7e3f7d6 commit 507d7e4

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/cargo/sources/git/utils.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ pub fn with_fetch_options(
695695
let mut progress = Progress::new("Fetch", config);
696696
network::with_retry(config, || {
697697
with_authentication(url, git_config, |f| {
698-
let mut last_recv = 0.0; // in Byte
698+
let mut last_recv = 0; // in Byte
699699
let mut last_update = Instant::now();
700700
let mut rcb = git2::RemoteCallbacks::new();
701701
rcb.credentials(f);
@@ -707,8 +707,8 @@ pub fn with_fetch_options(
707707
} else {
708708
// Receiving objects.
709709
let duration = last_update.elapsed();
710-
let recv = stats.received_bytes() as f32;
711-
let rate = (recv - last_recv) / duration.as_secs_f32();
710+
let recv = stats.received_bytes();
711+
let rate = (recv - last_recv) as f32 / duration.as_secs_f32();
712712
if duration > Duration::from_secs(3) {
713713
last_recv = recv;
714714
last_update = Instant::now();
@@ -718,9 +718,8 @@ pub fn with_fetch_options(
718718
let i = (bytes.log2() / 10.0).min(4.0) as usize;
719719
(UNITS[i], bytes / 1024_f32.powi(i as i32))
720720
}
721-
let (rate_unit, rate) = format_bytes(rate);
722-
let (unit, recv) = format_bytes(recv);
723-
format!(", {:.2}{}iB | {:.2}{}iB/s", recv, unit, rate, rate_unit)
721+
let (unit, rate) = format_bytes(rate);
722+
format!(", {:.2}{}iB/s", rate, unit)
724723
};
725724
progress
726725
.tick(stats.indexed_objects(), stats.total_objects(), &msg)

0 commit comments

Comments
 (0)