diff --git a/src/uu/shred/src/shred.rs b/src/uu/shred/src/shred.rs index 8a73eb1f1..12cd67acd 100644 --- a/src/uu/shred/src/shred.rs +++ b/src/uu/shred/src/shred.rs @@ -474,7 +474,7 @@ fn wipe_file( let size = match size { Some(size) => size, - None => get_file_size(path)?, + None => metadata.len(), }; for (i, pass_type) in pass_sequence.into_iter().enumerate() { @@ -532,10 +532,6 @@ fn do_pass( Ok(()) } -fn get_file_size(path: &Path) -> Result { - Ok(fs::metadata(path)?.len()) -} - // Repeatedly renames the file with strings of decreasing length (most likely all 0s) // Return the path of the file after its last renaming or None if error fn wipe_name(orig_path: &Path, verbose: bool, remove_method: RemoveMethod) -> Option {