We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3a214f2 + 35610ba commit 614531dCopy full SHA for 614531d
1 file changed
src/uu/mv/src/mv.rs
@@ -1094,10 +1094,7 @@ fn rename_file_fallback(
1094
}
1095
1096
fn is_empty_dir(path: &Path) -> bool {
1097
- match fs::read_dir(path) {
1098
- Ok(contents) => contents.peekable().peek().is_none(),
1099
- Err(_e) => false,
1100
- }
+ fs::read_dir(path).is_ok_and(|mut contents| contents.next().is_none())
1101
1102
1103
/// Checks if a file can be deleted by attempting to open it with delete permissions.
0 commit comments