diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-08-10 16:52:19 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-08-10 16:52:19 +0800 |
| commit | 02e07a18fcb3af9319c271f6e41d5b7785e2e436 (patch) | |
| tree | ff76916c254e87a7aadc5cb4dfd2134eaf4f03fc /arg_picker/src/builtin/pick_pathbuf.rs | |
| parent | 03b487f0f93ac32835149d4c1a0fb420341134f8 (diff) | |
style: satisfy clippy pedantic and nursery lints
Diffstat (limited to 'arg_picker/src/builtin/pick_pathbuf.rs')
| -rw-r--r-- | arg_picker/src/builtin/pick_pathbuf.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/arg_picker/src/builtin/pick_pathbuf.rs b/arg_picker/src/builtin/pick_pathbuf.rs index 3bd4410..2b48e3d 100644 --- a/arg_picker/src/builtin/pick_pathbuf.rs +++ b/arg_picker/src/builtin/pick_pathbuf.rs @@ -7,12 +7,8 @@ use crate::{ impl SinglePickable for PathBuf { fn pick_single(str: Option<&str>) -> crate::PickerArgResult<Self> { - match str { - Some(str) => match just_fmt::fmt_path_str(str) { - Ok(formated) => Parsed(PathBuf::from(formated)), - Err(_) => NotFound, - }, - None => NotFound, - } + str.map_or(NotFound, |str| { + just_fmt::fmt_path_str(str).map_or(NotFound, |formated| Parsed(Self::from(formated))) + }) } } |
