@@ -404,7 +404,7 @@ pub fn safe_remove_dir_recursive_impl(path: &Path, dir_fd: &DirFd, options: &Opt
404404 let entry_stat = match dir_fd. stat_at ( & entry_name, false ) {
405405 Ok ( stat) => stat,
406406 Err ( e) => {
407- error = handle_error_with_force ( e, & entry_path, options) ;
407+ error | = handle_error_with_force ( e, & entry_path, options) ;
408408 continue ;
409409 }
410410 } ;
@@ -428,21 +428,21 @@ pub fn safe_remove_dir_recursive_impl(path: &Path, dir_fd: &DirFd, options: &Opt
428428 // If we can't open the subdirectory for safe traversal,
429429 // try to handle it as best we can with safe operations
430430 if e. kind ( ) == std:: io:: ErrorKind :: PermissionDenied {
431- error = handle_permission_denied (
431+ error | = handle_permission_denied (
432432 dir_fd,
433433 entry_name. as_ref ( ) ,
434434 & entry_path,
435435 options,
436436 ) ;
437437 } else {
438- error = handle_error_with_force ( e, & entry_path, options) ;
438+ error | = handle_error_with_force ( e, & entry_path, options) ;
439439 }
440440 continue ;
441441 }
442442 } ;
443443
444444 let child_error = safe_remove_dir_recursive_impl ( & entry_path, & child_dir_fd, options) ;
445- error = error || child_error;
445+ error |= child_error;
446446
447447 // Ask user permission if needed for this subdirectory
448448 if !child_error
@@ -454,12 +454,12 @@ pub fn safe_remove_dir_recursive_impl(path: &Path, dir_fd: &DirFd, options: &Opt
454454
455455 // Remove the now-empty subdirectory using safe unlinkat
456456 if !child_error {
457- error = handle_unlink ( dir_fd, entry_name. as_ref ( ) , & entry_path, true , options) ;
457+ error | = handle_unlink ( dir_fd, entry_name. as_ref ( ) , & entry_path, true , options) ;
458458 }
459459 } else {
460460 // Remove file - check if user wants to remove it first
461461 if prompt_file_with_stat ( & entry_path, & entry_stat, options) {
462- error = handle_unlink ( dir_fd, entry_name. as_ref ( ) , & entry_path, false , options) ;
462+ error | = handle_unlink ( dir_fd, entry_name. as_ref ( ) , & entry_path, false , options) ;
463463 }
464464 }
465465 }
0 commit comments