1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

ln: remove redundant check

if `dst.exists()` and `settings.overwrite` is `OverwriteMode::Force`,
we already delete the file in the match above.
This commit is contained in:
Michael Debertol 2021-06-03 15:05:20 +02:00
parent ed69d797b5
commit af8f47ea6a

View file

@ -422,11 +422,6 @@ fn link(src: &Path, dst: &Path, settings: &Settings) -> Result<()> {
}
}
if settings.no_dereference && matches!(settings.overwrite, OverwriteMode::Force) && dst.exists()
{
fs::remove_file(dst)?;
}
if settings.symbolic {
symlink(&source, dst)?;
} else {