Skip to content

Commit 614531d

Browse files
authored
Merge branch 'main' into refactor-mkdir-mode-parsing
2 parents 3a214f2 + 35610ba commit 614531d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/uu/mv/src/mv.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,10 +1094,7 @@ fn rename_file_fallback(
10941094
}
10951095

10961096
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-
}
1097+
fs::read_dir(path).is_ok_and(|mut contents| contents.next().is_none())
11011098
}
11021099

11031100
/// Checks if a file can be deleted by attempting to open it with delete permissions.

0 commit comments

Comments
 (0)