Skip to content

Commit 4fb0779

Browse files
committed
fix(clippy): collapse nested if and use clone instead of to_path_buf
1 parent fc1f8b2 commit 4fb0779

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/uu/install/src/install.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,10 +611,8 @@ fn standard(mut paths: Vec<OsString>, b: &Behavior) -> UResult<()> {
611611
};
612612

613613
// If -t is used, check if target exists as a file before trying to create directories
614-
if b.target_dir.is_some() {
615-
if target.exists() && !target.is_dir() {
616-
return Err(InstallError::NotADirectory(target.to_path_buf()).into());
617-
}
614+
if b.target_dir.is_some() && target.exists() && !target.is_dir() {
615+
return Err(InstallError::NotADirectory(target.clone()).into());
618616
}
619617

620618
if let Some(to_create) = to_create {

0 commit comments

Comments
 (0)