1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-31 13:07:46 +00:00

Merge pull request #5143 from cakebaker/mv_remove_unnecessary_or

mv: remove unnecessary OR in condition
This commit is contained in:
Terts Diepraam 2023-08-10 23:33:40 +02:00 committed by GitHub
commit 268292f9f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -433,9 +433,7 @@ fn rename(
let mut backup_path = None;
if to.exists() {
if (b.update == UpdateMode::ReplaceIfOlder || b.update == UpdateMode::ReplaceNone)
&& b.overwrite == OverwriteMode::Interactive
{
if b.update == UpdateMode::ReplaceIfOlder && b.overwrite == OverwriteMode::Interactive {
// `mv -i --update old new` when `new` exists doesn't move anything
// and exit with 0
return Ok(());