mirror of
https://github.com/uutils/coreutils.git
synced 2025-12-23 08:47:37 +00:00
cp: fix clippy warning for unnecessary closure
This commit is contained in:
parent
e41f2118c6
commit
56dc2be9e1
1 changed files with 1 additions and 1 deletions
|
|
@ -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());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue