cp: fix clippy warning for unnecessary closure

This commit is contained in:
Vesal J 2025-09-07 03:45:56 +03:30
parent e41f2118c6
commit 56dc2be9e1

View file

@ -342,7 +342,7 @@ pub(crate) fn copy_directory(
// check if root is a prefix of target
if path_has_prefix(target, root)? {
let dest_name = root.file_name().unwrap_or_else(|| root.as_os_str());
let dest_name = root.file_name().unwrap_or(root.as_os_str());
return Err(translate!("cp-error-cannot-copy-directory-into-itself", "source" => root.quote(), "dest" => target.join(dest_name).quote())
.into());
}