diff --git a/src/uu/mv/src/mv.rs b/src/uu/mv/src/mv.rs index 4697fac4a..671aea0ad 100644 --- a/src/uu/mv/src/mv.rs +++ b/src/uu/mv/src/mv.rs @@ -475,11 +475,11 @@ fn rename_symlink_fallback(from: &Path, to: &Path) -> io::Result<()> { { if path_symlink_points_to.exists() { if path_symlink_points_to.is_dir() { - windows::fs::symlink_dir(&path_symlink_points_to, &to)?; + windows::fs::symlink_dir(&path_symlink_points_to, to)?; } else { - windows::fs::symlink_file(&path_symlink_points_to, &to)?; + windows::fs::symlink_file(&path_symlink_points_to, to)?; } - fs::remove_file(&from)?; + fs::remove_file(from)?; } else { return Err(io::Error::new( io::ErrorKind::NotFound, diff --git a/src/uu/rm/src/rm.rs b/src/uu/rm/src/rm.rs index f65ebb2fa..5be19893b 100644 --- a/src/uu/rm/src/rm.rs +++ b/src/uu/rm/src/rm.rs @@ -170,7 +170,7 @@ pub fn uu_app() -> Command { Arg::new(OPT_PROMPT) .short('i') .help("prompt before every removal") - .overrides_with_all(&[OPT_PROMPT_MORE, OPT_INTERACTIVE]) + .overrides_with_all([OPT_PROMPT_MORE, OPT_INTERACTIVE]) .action(ArgAction::SetTrue), ) .arg( @@ -178,7 +178,7 @@ pub fn uu_app() -> Command { .short('I') .help("prompt once before removing more than three files, or when removing recursively. \ Less intrusive than -i, while still giving some protection against most mistakes") - .overrides_with_all(&[OPT_PROMPT, OPT_INTERACTIVE]) + .overrides_with_all([OPT_PROMPT, OPT_INTERACTIVE]) .action(ArgAction::SetTrue), ) .arg( @@ -189,7 +189,7 @@ pub fn uu_app() -> Command { prompts always", ) .value_name("WHEN") - .overrides_with_all(&[OPT_PROMPT, OPT_PROMPT_MORE]), + .overrides_with_all([OPT_PROMPT, OPT_PROMPT_MORE]), ) .arg( Arg::new(OPT_ONE_FILE_SYSTEM) diff --git a/src/uucore/src/lib/features/fsext.rs b/src/uucore/src/lib/features/fsext.rs index f306f34de..68e2b7a55 100644 --- a/src/uucore/src/lib/features/fsext.rs +++ b/src/uucore/src/lib/features/fsext.rs @@ -303,7 +303,7 @@ impl MountInfo { let mut mn_info = Self { dev_id: volume_name, dev_name, - fs_type: fs_type.unwrap_or_else(|| "".to_string()), + fs_type: fs_type.unwrap_or_default(), mount_root, mount_dir: "".to_string(), mount_option: "".to_string(), diff --git a/tests/by-util/test_env.rs b/tests/by-util/test_env.rs index 3172320f3..9b6452548 100644 --- a/tests/by-util/test_env.rs +++ b/tests/by-util/test_env.rs @@ -220,7 +220,7 @@ fn test_change_directory() { let out = scene .ucmd() .arg("--chdir") - .arg(&temporary_path) + .arg(temporary_path) .args(&pwd) .succeeds() .stdout_move_str();