Skip to content

Commit

Permalink
Merge pull request #5755 from sylvestre/syntax
Browse files Browse the repository at this point in the history
rm: improve the code a tiny bit
  • Loading branch information
cakebaker authored Dec 31, 2023
2 parents 5cbf6c2 + b07ea95 commit ed11132
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/uu/rm/src/rm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ed11132

Please sign in to comment.