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_pathbuf.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'arg_picker/src/builtin/pick_pathbuf.rs') 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 { - 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))) + }) } } -- cgit