Skip to content

Commit

Permalink
Upgrade dependency size to 0.4
Browse files Browse the repository at this point in the history
`size` 0.4 uses the builder api for manually formatting sizes so that only the
parameters you wish to change (in this case, `Base` but not `Style`) need to be
listed.

This patch should only be merged after gorilla-devs/libium#8 is merged and this
crate is updated to use that release of libium, to keep the `size` crates
aligned.
  • Loading branch information
mqudsi committed Jun 23, 2022
1 parent 8660128 commit 66f630c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 8 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -48,7 +48,7 @@ semver = "~1.0.10"
online = "~3.0.1"
bytes = "~1.1.0"
furse = "~1.4.0"
size = "~0.2.0"
size = "~0.4.0"
url = "~2.2.2"

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions src/download.rs
Expand Up @@ -8,7 +8,7 @@ use fs_extra::{
use indicatif::ProgressBar;
use itertools::Itertools;
use libium::{mutex_ext::MutexExt, upgrade::Downloadable};
use size::{Base, Style};
use size::Base;
use std::{
ffi::OsString,
fs::read_dir,
Expand Down Expand Up @@ -129,7 +129,7 @@ pub async fn download(
"{} Downloaded {:7} {}",
&*TICK,
match size {
Some(size) => size.to_string(Base::Base10, Style::Smart),
Some(size) => size.format().with_base(Base::Base10),
None => String::new(),
},
filename.dimmed(),
Expand Down

0 comments on commit 66f630c

Please sign in to comment.