1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

fixup! du: remove crash! macro

This commit is contained in:
Alexandre Hausen 2023-11-08 20:32:03 -03:00
parent e11878e7ba
commit 4d40555cd5

View file

@ -255,13 +255,8 @@ fn get_file_info(path: &Path) -> Option<FileInfo> {
fn read_block_size(s: Option<&str>) -> UResult<u64> {
if let Some(s) = s {
match parse_size_u64(s) {
Ok(x) => Ok(x),
Err(e) => Err(USimpleError::new(
1,
format_error_message(&e, s, options::BLOCK_SIZE),
)),
}
parse_size_u64(s)
.map_err(|e| USimpleError::new(1, format_error_message(&e, s, options::BLOCK_SIZE)))
} else {
for env_var in ["DU_BLOCK_SIZE", "BLOCK_SIZE", "BLOCKSIZE"] {
if let Ok(env_size) = env::var(env_var) {