mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
rm: improve the code a tiny bit
This commit is contained in:
parent
5fc01f718a
commit
b07ea957d3
1 changed files with 1 additions and 1 deletions
|
@ -334,7 +334,7 @@ fn handle_dir(path: &Path, options: &Options) -> bool {
|
|||
// remove_dir_all failed. maybe it is because of the permissions
|
||||
// but if the directory is empty, remove_dir might work.
|
||||
// So, let's try that before failing for real
|
||||
if let Err(_e) = fs::remove_dir(path) {
|
||||
if fs::remove_dir(path).is_err() {
|
||||
had_err = true;
|
||||
if e.kind() == std::io::ErrorKind::PermissionDenied {
|
||||
// GNU compatibility (rm/fail-eacces.sh)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue