From 02e07a18fcb3af9319c271f6e41d5b7785e2e436 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 10 Aug 2026 16:52:19 +0800 Subject: style: satisfy clippy pedantic and nursery lints --- arg_picker/src/builtin/pick_paths.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'arg_picker/src/builtin/pick_paths.rs') diff --git a/arg_picker/src/builtin/pick_paths.rs b/arg_picker/src/builtin/pick_paths.rs index 8e6c0fd..954464b 100644 --- a/arg_picker/src/builtin/pick_paths.rs +++ b/arg_picker/src/builtin/pick_paths.rs @@ -17,7 +17,7 @@ impl SinglePickable for FilePath { match ::pick_single(str) { Parsed(path) => { if path.exists() && path.is_file() { - Parsed(FilePath::from(path)) + Parsed(Self::from(path)) } else { NotFound } @@ -33,7 +33,7 @@ impl SinglePickable for NoFilePath { match ::pick_single(str) { Parsed(path) => { if !path.exists() || !path.is_file() { - Parsed(NoFilePath::from(path)) + Parsed(Self::from(path)) } else { NotFound } @@ -49,7 +49,7 @@ impl SinglePickable for DirPath { match ::pick_single(str) { Parsed(path) => { if path.exists() && path.is_dir() { - Parsed(DirPath::from(path)) + Parsed(Self::from(path)) } else { NotFound } @@ -65,7 +65,7 @@ impl SinglePickable for NoDirPath { match ::pick_single(str) { Parsed(path) => { if !path.exists() || !path.is_dir() { - Parsed(NoDirPath::from(path)) + Parsed(Self::from(path)) } else { NotFound } @@ -81,7 +81,7 @@ impl SinglePickable for SymlinkPath { match ::pick_single(str) { Parsed(path) => { if path.exists() && path.is_symlink() { - Parsed(SymlinkPath::from(path)) + Parsed(Self::from(path)) } else { NotFound } @@ -97,7 +97,7 @@ impl SinglePickable for NoSymlinkPath { match ::pick_single(str) { Parsed(path) => { if !path.exists() || !path.is_symlink() { - Parsed(NoSymlinkPath::from(path)) + Parsed(Self::from(path)) } else { NotFound } @@ -112,10 +112,10 @@ impl SinglePickable for NoPath { fn pick_single(str: Option<&str>) -> PickerArgResult { match ::pick_single(str) { Parsed(path) => { - if !path.exists() { - Parsed(NoPath::from(path)) - } else { + if path.exists() { NotFound + } else { + Parsed(Self::from(path)) } } Unparsed => Unparsed, @@ -132,7 +132,7 @@ impl SinglePickable for RecursiveFiles { return NotFound; } if path.is_file() || path.is_symlink() { - return Parsed(RecursiveFiles::from(vec![path])); + return Parsed(Self::from(vec![path])); } let mut entries = Vec::new(); if let Ok(dir_entries) = fs::read_dir(&path) { @@ -145,7 +145,7 @@ impl SinglePickable for RecursiveFiles { } } } - Parsed(RecursiveFiles::from(entries)) + Parsed(Self::from(entries)) } Unparsed => Unparsed, NotFound => NotFound, -- cgit