mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-06 19:45:29 +00:00
replace usage of ubyte
by our own Bytes
formatter
This commit is contained in:
parent
693167e933
commit
cbd327aad7
7
Cargo.lock
generated
7
Cargo.lock
generated
@ -735,7 +735,6 @@ dependencies = [
|
|||||||
"tempfile",
|
"tempfile",
|
||||||
"test-strategy",
|
"test-strategy",
|
||||||
"time",
|
"time",
|
||||||
"ubyte",
|
|
||||||
"xz2",
|
"xz2",
|
||||||
"zip",
|
"zip",
|
||||||
"zstd",
|
"zstd",
|
||||||
@ -1188,12 +1187,6 @@ dependencies = [
|
|||||||
"static_assertions",
|
"static_assertions",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ubyte"
|
|
||||||
version = "0.10.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "c81f0dae7d286ad0d9366d7679a77934cfc3cf3a8d67e82669794412b2368fe6"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unarray"
|
name = "unarray"
|
||||||
version = "0.1.4"
|
version = "0.1.4"
|
||||||
|
@ -30,7 +30,6 @@ snap = "1.1.0"
|
|||||||
tar = "0.4.40"
|
tar = "0.4.40"
|
||||||
tempfile = "3.8.0"
|
tempfile = "3.8.0"
|
||||||
time = { version = "0.3.28", default-features = false }
|
time = { version = "0.3.28", default-features = false }
|
||||||
ubyte = { version = "0.10.3", default-features = false }
|
|
||||||
xz2 = "0.1.7"
|
xz2 = "0.1.7"
|
||||||
zip = { version = "0.6.6", default-features = false, features = ["time"] }
|
zip = { version = "0.6.6", default-features = false, features = ["time"] }
|
||||||
zstd = { version = "0.12.4", default-features = false }
|
zstd = { version = "0.12.4", default-features = false }
|
||||||
|
@ -10,13 +10,12 @@ use std::{
|
|||||||
|
|
||||||
use fs_err as fs;
|
use fs_err as fs;
|
||||||
use same_file::Handle;
|
use same_file::Handle;
|
||||||
use ubyte::ToByteUnit;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
error::FinalError,
|
error::FinalError,
|
||||||
info,
|
info,
|
||||||
list::FileInArchive,
|
list::FileInArchive,
|
||||||
utils::{self, EscapedPathDisplay, FileVisibilityPolicy},
|
utils::{self, Bytes, EscapedPathDisplay, FileVisibilityPolicy},
|
||||||
warning,
|
warning,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -41,7 +40,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()?)),
|
||||||
file.size().bytes(),
|
Bytes::new(file.size()),
|
||||||
);
|
);
|
||||||
|
|
||||||
files_unpacked += 1;
|
files_unpacked += 1;
|
||||||
|
@ -14,7 +14,6 @@ use filetime::{set_file_mtime, FileTime};
|
|||||||
use fs_err as fs;
|
use fs_err as fs;
|
||||||
use same_file::Handle;
|
use same_file::Handle;
|
||||||
use time::OffsetDateTime;
|
use time::OffsetDateTime;
|
||||||
use ubyte::ToByteUnit;
|
|
||||||
use zip::{self, read::ZipFile, DateTime, ZipArchive};
|
use zip::{self, read::ZipFile, DateTime, ZipArchive};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@ -22,7 +21,7 @@ use crate::{
|
|||||||
info,
|
info,
|
||||||
list::FileInArchive,
|
list::FileInArchive,
|
||||||
utils::{
|
utils::{
|
||||||
self, cd_into_same_dir_as, get_invalid_utf8_paths, pretty_format_list_of_paths, strip_cur_dir,
|
self, cd_into_same_dir_as, get_invalid_utf8_paths, pretty_format_list_of_paths, strip_cur_dir, Bytes,
|
||||||
EscapedPathDisplay, FileVisibilityPolicy,
|
EscapedPathDisplay, FileVisibilityPolicy,
|
||||||
},
|
},
|
||||||
warning,
|
warning,
|
||||||
@ -74,7 +73,7 @@ where
|
|||||||
inaccessible,
|
inaccessible,
|
||||||
"{:?} extracted. ({})",
|
"{:?} extracted. ({})",
|
||||||
file_path.display(),
|
file_path.display(),
|
||||||
file.size().bytes()
|
Bytes::new(file.size()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,9 @@ mod fs;
|
|||||||
mod question;
|
mod question;
|
||||||
|
|
||||||
pub use file_visibility::FileVisibilityPolicy;
|
pub use file_visibility::FileVisibilityPolicy;
|
||||||
pub use formatting::{nice_directory_display, pretty_format_list_of_paths, strip_cur_dir, to_utf, EscapedPathDisplay};
|
pub use formatting::{
|
||||||
|
nice_directory_display, pretty_format_list_of_paths, strip_cur_dir, to_utf, Bytes, EscapedPathDisplay,
|
||||||
|
};
|
||||||
pub use fs::{
|
pub use fs::{
|
||||||
cd_into_same_dir_as, clear_path, create_dir_if_non_existent, is_symlink, remove_file_or_dir, try_infer_extension,
|
cd_into_same_dir_as, clear_path, create_dir_if_non_existent, is_symlink, remove_file_or_dir, try_infer_extension,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user