mirror of
https://github.com/uutils/coreutils
synced 2024-12-13 06:42:42 +00:00
Merge pull request #4108 from cakebaker/rm_fix_clippy_warnings
Fix clippy warnings
This commit is contained in:
commit
2af01ec344
4 changed files with 8 additions and 8 deletions
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue