Skip to content

Commit

Permalink
crate download: don't print that a crate was the largest download if …
Browse files Browse the repository at this point in the history
…it was the only download

before:

    Updating crates.io index
  Downloaded procs v0.8.4
  Downloaded 1 crates (1.1 MB) in 2.90s (largest was `procs` at 1.1 MB)
  Installing procs v0.8.4

after:

    Updating crates.io index
  Downloaded procs v0.8.4
  Downloaded 1 crates (1.1 MB) in 1.50s
  Installing procs v0.8.4
  • Loading branch information
matthiaskrgr committed May 7, 2019
1 parent b48ae60 commit a7d7821
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cargo/core/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,10 @@ impl<'a, 'cfg> Drop for Downloads<'a, 'cfg> {
ByteSize(self.downloaded_bytes),
util::elapsed(self.start.elapsed())
);
if self.largest.0 > ByteSize::mb(1).0 {
// print the size of largest crate if it was >1mb
// however don't print if only a single crate was downloaded
// because it is obvious that it will be the largest then
if self.largest.0 > ByteSize::mb(1).0 && self.downloads_finished > 1 {
status.push_str(&format!(
" (largest was `{}` at {})",
self.largest.1,
Expand Down

0 comments on commit a7d7821

Please sign in to comment.