Skip to content

Commit

Permalink
Use ubyte instead of humansize
Browse files Browse the repository at this point in the history
  • Loading branch information
vrmiguel committed Jan 5, 2023
1 parent 9fdc7ed commit 370caf8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
23 changes: 7 additions & 16 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
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ clap = { version = "4.0.32", features = ["derive", "env"] }
filetime = "0.2.19"
flate2 = { version = "1.0.25", default-features = false }
fs-err = "2.9.0"
humansize = "2.1.3"
ignore = "0.4.18"
libc = "0.2.139"
linked-hash-map = "0.5.6"
Expand All @@ -28,6 +27,7 @@ same-file = "1.0.6"
snap = "1.1.0"
tar = "0.4.38"
tempfile = "3.3.0"
ubyte = { version = "0.10.3", default-features = false }
xz2 = "0.1.7"
zip = { version = "0.6.3", default-features = false, features = ["time"] }
zstd = { version = "0.12.1", default-features = false }
Expand Down
5 changes: 3 additions & 2 deletions src/archive/tar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ use std::{
};

use fs_err as fs;
use humansize::{format_size, DECIMAL};
// use humansize::{format_size, DECIMAL};
use same_file::Handle;
use ubyte::ToByteUnit;

use crate::{
error::FinalError,
Expand Down Expand Up @@ -42,7 +43,7 @@ pub fn unpack_archive(reader: Box<dyn Read>, output_folder: &Path, quiet: bool)
inaccessible,
"{:?} extracted. ({})",
utils::strip_cur_dir(&output_folder.join(file.path()?)),
format_size(file.size(), DECIMAL),
file.size().bytes(),
);

files_unpacked.push(file_path);
Expand Down
4 changes: 2 additions & 2 deletions src/archive/zip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use std::{

use filetime::{set_file_mtime, FileTime};
use fs_err as fs;
use humansize::{format_size, DECIMAL};
use same_file::Handle;
use ubyte::ToByteUnit;
use zip::{self, read::ZipFile, DateTime, ZipArchive};

use crate::{
Expand Down Expand Up @@ -73,7 +73,7 @@ where
inaccessible,
"{:?} extracted. ({})",
file_path.display(),
format_size(file.size(), DECIMAL),
file.size().bytes()
);
}

Expand Down

0 comments on commit 370caf8

Please sign in to comment.