mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
refactor: consolidate branches
This commit is contained in:
parent
29a610d389
commit
b0bb9f19d8
1 changed files with 12 additions and 12 deletions
|
|
@ -67,18 +67,18 @@ impl Actor for Rename {
|
|||
return;
|
||||
};
|
||||
|
||||
if opt.force || !maybe_exists(&new).await || provider::must_identical(&old, &new).await {
|
||||
if conversion_to_dir_requested && target_is_empty {
|
||||
Self::replace_file_with_dir(old, new).await.ok();
|
||||
} else {
|
||||
Self::r#do(tab, old, new).await.ok();
|
||||
}
|
||||
} else if ConfirmProxy::show(ConfirmCfg::overwrite(&new)).await {
|
||||
if conversion_to_dir_requested && target_is_empty {
|
||||
Self::replace_file_with_dir(old, new).await.ok();
|
||||
} else {
|
||||
Self::r#do(tab, old, new).await.ok();
|
||||
}
|
||||
if !opt.force
|
||||
&& maybe_exists(&new).await
|
||||
&& !provider::must_identical(&old, &new).await
|
||||
&& !ConfirmProxy::show(ConfirmCfg::overwrite(&new)).await
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if conversion_to_dir_requested && target_is_empty {
|
||||
Self::replace_file_with_dir(old, new).await.ok();
|
||||
} else {
|
||||
Self::r#do(tab, old, new).await.ok();
|
||||
}
|
||||
});
|
||||
succ!();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue