style(rm): wrap long line in prompt_file_with_stat macro for readability
Reformatted the prompt_yes! macro call across multiple lines to improve code readability and adhere to line length conventions. No functional changes.
38d339d
3 hours ago
by mattsu2020
-14.61%
refactor(linux/rm): refactor safe_remove_dir_recursive for better FD management and error handling
Restructure directory opening and traversal logic to collect entries upfront and drop DirFd early, preventing deep descriptor stacks. Improve permission denied error handling to match GNU rm behavior while maintaining secure operations. This enhances resource efficiency and compatibility without altering functional behavior.
bf28c9a
1 hour ago
by mattsu2020
+2.8%
feat(rm): add progress bar support to recursive dir removal on Linux
Refactor `safe_remove_dir_recursive_impl` to accept an optional `ProgressBar` parameter instead of `dir_fd`, opening the directory internally. Add progress increments for each removed item to improve user feedback during long recursive operations.
6a9f123
1 hour ago
by mattsu2020
0%
refactor(rm): simplify control flow in safe_remove_dir_recursive_impl
Replaced nested if-else logic with direct else-if in the file removal path to reduce code nesting and improve readability for handling interactive prompts during recursive directory removal.
2957789
1 hour ago
by mattsu2020
0%
refactor: remove handle_permission_denied function from rm linux platform
Remove the obsolete `handle_permission_denied` helper function in `src/uu/rm/src/platform/linux.rs`. This function was handling permission denied errors when attempting to remove subdirectories during recursive removal. Its removal simplifies the code and aligns with updated error handling logic, potentially avoiding redundant or buggy behavior in edge cases. The change maintains compatibility for standard rm operations while reducing complexity.
1f78fc6
1 hour ago
by mattsu2020
-2.8%
perf(linux/rm): optimize descriptor usage by keeping dir_fd open in safe_remove_dir_recursive_impl
Reuse the existing directory file descriptor instead of opening/closing new ones for each subdirectory or file during recursive removal. This simplifies the code, reduces overhead from descriptor management, and prevents potential deep descriptor stacks on systems with many nested directories. Removed unnecessary `drop(dir_fd)` call and adjusted progress bar increments accordingly.
188d9cf
38 minutes ago
by mattsu2020
-2.41%
style(rm): reformat error assignment in safe_remove_dir_recursive_impl
Break the long error assignment line for better readability, ensuring consistent code formatting in the rm utility's Linux platform implementation.