mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 12:05:46 +00:00
Use ubyte
instead of humansize
This commit is contained in:
parent
9fdc7edf1e
commit
d99266e1ce
23
Cargo.lock
generated
23
Cargo.lock
generated
@ -348,15 +348,6 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "humansize"
|
|
||||||
version = "2.1.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7"
|
|
||||||
dependencies = [
|
|
||||||
"libm",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ignore"
|
name = "ignore"
|
||||||
version = "0.4.18"
|
version = "0.4.18"
|
||||||
@ -460,12 +451,6 @@ version = "0.2.139"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
|
checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "libm"
|
|
||||||
version = "0.2.6"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libz-sys"
|
name = "libz-sys"
|
||||||
version = "1.1.8"
|
version = "1.1.8"
|
||||||
@ -568,7 +553,6 @@ dependencies = [
|
|||||||
"filetime",
|
"filetime",
|
||||||
"flate2",
|
"flate2",
|
||||||
"fs-err",
|
"fs-err",
|
||||||
"humansize",
|
|
||||||
"ignore",
|
"ignore",
|
||||||
"infer",
|
"infer",
|
||||||
"is_executable",
|
"is_executable",
|
||||||
@ -585,6 +569,7 @@ dependencies = [
|
|||||||
"tempfile",
|
"tempfile",
|
||||||
"test-strategy",
|
"test-strategy",
|
||||||
"time",
|
"time",
|
||||||
|
"ubyte",
|
||||||
"xz2",
|
"xz2",
|
||||||
"zip",
|
"zip",
|
||||||
"zstd",
|
"zstd",
|
||||||
@ -991,6 +976,12 @@ dependencies = [
|
|||||||
"time-core",
|
"time-core",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ubyte"
|
||||||
|
version = "0.10.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c81f0dae7d286ad0d9366d7679a77934cfc3cf3a8d67e82669794412b2368fe6"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-ident"
|
name = "unicode-ident"
|
||||||
version = "1.0.6"
|
version = "1.0.6"
|
||||||
|
@ -18,7 +18,6 @@ clap = { version = "4.0.32", features = ["derive", "env"] }
|
|||||||
filetime = "0.2.19"
|
filetime = "0.2.19"
|
||||||
flate2 = { version = "1.0.25", default-features = false }
|
flate2 = { version = "1.0.25", default-features = false }
|
||||||
fs-err = "2.9.0"
|
fs-err = "2.9.0"
|
||||||
humansize = "2.1.3"
|
|
||||||
ignore = "0.4.18"
|
ignore = "0.4.18"
|
||||||
libc = "0.2.139"
|
libc = "0.2.139"
|
||||||
linked-hash-map = "0.5.6"
|
linked-hash-map = "0.5.6"
|
||||||
@ -28,6 +27,7 @@ same-file = "1.0.6"
|
|||||||
snap = "1.1.0"
|
snap = "1.1.0"
|
||||||
tar = "0.4.38"
|
tar = "0.4.38"
|
||||||
tempfile = "3.3.0"
|
tempfile = "3.3.0"
|
||||||
|
ubyte = { version = "0.10.3", default-features = false }
|
||||||
xz2 = "0.1.7"
|
xz2 = "0.1.7"
|
||||||
zip = { version = "0.6.3", default-features = false, features = ["time"] }
|
zip = { version = "0.6.3", default-features = false, features = ["time"] }
|
||||||
zstd = { version = "0.12.1", default-features = false }
|
zstd = { version = "0.12.1", default-features = false }
|
||||||
|
@ -9,8 +9,8 @@ use std::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use fs_err as fs;
|
use fs_err as fs;
|
||||||
use humansize::{format_size, DECIMAL};
|
|
||||||
use same_file::Handle;
|
use same_file::Handle;
|
||||||
|
use ubyte::ToByteUnit;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
error::FinalError,
|
error::FinalError,
|
||||||
@ -42,7 +42,7 @@ pub fn unpack_archive(reader: Box<dyn Read>, output_folder: &Path, quiet: bool)
|
|||||||
inaccessible,
|
inaccessible,
|
||||||
"{:?} extracted. ({})",
|
"{:?} extracted. ({})",
|
||||||
utils::strip_cur_dir(&output_folder.join(file.path()?)),
|
utils::strip_cur_dir(&output_folder.join(file.path()?)),
|
||||||
format_size(file.size(), DECIMAL),
|
file.size().bytes(),
|
||||||
);
|
);
|
||||||
|
|
||||||
files_unpacked.push(file_path);
|
files_unpacked.push(file_path);
|
||||||
|
@ -12,8 +12,8 @@ use std::{
|
|||||||
|
|
||||||
use filetime::{set_file_mtime, FileTime};
|
use filetime::{set_file_mtime, FileTime};
|
||||||
use fs_err as fs;
|
use fs_err as fs;
|
||||||
use humansize::{format_size, DECIMAL};
|
|
||||||
use same_file::Handle;
|
use same_file::Handle;
|
||||||
|
use ubyte::ToByteUnit;
|
||||||
use zip::{self, read::ZipFile, DateTime, ZipArchive};
|
use zip::{self, read::ZipFile, DateTime, ZipArchive};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@ -73,7 +73,7 @@ where
|
|||||||
inaccessible,
|
inaccessible,
|
||||||
"{:?} extracted. ({})",
|
"{:?} extracted. ({})",
|
||||||
file_path.display(),
|
file_path.display(),
|
||||||
format_size(file.size(), DECIMAL),
|
file.size().bytes()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user