Skip to content

Commit

Permalink
cp: use is_ok_and instead of map_or
Browse files Browse the repository at this point in the history
  • Loading branch information
cakebaker committed Jan 10, 2025
1 parent 9fe4c9f commit 5536720
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/uu/cp/src/platform/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub(crate) fn copy_on_write(
// clonefile(2) fails if the destination exists. Remove it and try again. Do not
// bother to check if removal worked because we're going to try to clone again.
// first lets make sure the dest file is not read only
if fs::metadata(dest).map_or(false, |md| !md.permissions().readonly()) {
if fs::metadata(dest).is_ok_and(|md| !md.permissions().readonly()) {
// remove and copy again
// TODO: rewrite this to better match linux behavior
// linux first opens the source file and destination file then uses the file
Expand Down

0 comments on commit 5536720

Please sign in to comment.