Skip to content

Commit d209e04

Browse files
committed
refactor(rm): simplify error handling logic in recursive directory removal
Remove unnecessary else block, ensuring error propagation and continuation occur consistently after directory closure checks in safe_remove_dir_recursive_impl, improving code clarity and reducing nesting.
1 parent 225dea4 commit d209e04

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/uu/rm/src/platform/linux.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,9 @@ pub fn safe_remove_dir_recursive_impl(
394394
continue;
395395
}
396396
}
397-
} else {
398-
error = handle_error_with_force(e, &entry_path, options) || error;
399-
continue;
400397
}
398+
error = handle_error_with_force(e, &entry_path, options) || error;
399+
continue;
401400
}
402401
};
403402

0 commit comments

Comments
 (0)