Skip to content

Commit f93f120

Browse files
committed
re-introduce io::ErrorKind matching.
1 parent 1b7f535 commit f93f120

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ include = [
1515
"CHANGELOG.md",
1616
"!**/tests/*",
1717
]
18+
rust-version = "1.83.0"
1819

1920
[features]
2021
default = ["tui-crossplatform", "trash-move"]

src/interactive/app/handlers.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -462,17 +462,15 @@ fn delete_directory_recursively(path: PathBuf) -> Result<(), usize> {
462462
}
463463
}
464464
}
465-
// Err(ref e) if e.kind() == io::ErrorKind::NotADirectory => {
466-
// // assume file, save IOps
467-
// num_errors += into_error_count(fs::remove_file(path));
468-
// continue;
469-
// }
470-
Err(_) => {
471-
// TODO: Reintroduce commented code once the `io_error_more` feature is stable
472-
// num_errors += 1;
465+
Err(ref e) if e.kind() == io::ErrorKind::NotADirectory => {
466+
// try again with file deletion instead.
473467
num_errors += into_error_count(fs::remove_file(path));
474468
continue;
475469
}
470+
Err(_) => {
471+
num_errors += 1;
472+
continue;
473+
}
476474
};
477475
}
478476

0 commit comments

Comments
 (0)