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:
parent
e11878e7ba
commit
4d40555cd5
1 changed files with 2 additions and 7 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue