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

mv: remove unnecessary "!"

This commit is contained in:
Daniel Hofstetter 2023-01-09 09:38:37 +01:00
parent 3033d017b5
commit aff18258e9

View file

@ -284,12 +284,12 @@ fn exec(files: &[OsString], b: &Behavior) -> UResult<()> {
if target.is_dir() { if target.is_dir() {
if b.no_target_dir { if b.no_target_dir {
if !source.is_dir() { if source.is_dir() {
Err(MvError::DirectoryToNonDirectory(target.quote().to_string()).into())
} else {
rename(source, target, b, None).map_err_context(|| { rename(source, target, b, None).map_err_context(|| {
format!("cannot move {} to {}", source.quote(), target.quote()) format!("cannot move {} to {}", source.quote(), target.quote())
}) })
} else {
Err(MvError::DirectoryToNonDirectory(target.quote().to_string()).into())
} }
} else { } else {
move_files_into_dir(&[source.clone()], target, b) move_files_into_dir(&[source.clone()], target, b)