aboutsummaryrefslogtreecommitdiff
path: root/arg_picker/src/parselib/single_matcher.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-08-10 16:52:19 +0800
committer魏曹先生 <1992414357@qq.com>2026-08-10 16:52:19 +0800
commit02e07a18fcb3af9319c271f6e41d5b7785e2e436 (patch)
treeff76916c254e87a7aadc5cb4dfd2134eaf4f03fc /arg_picker/src/parselib/single_matcher.rs
parent03b487f0f93ac32835149d4c1a0fb420341134f8 (diff)
style: satisfy clippy pedantic and nursery lints
Diffstat (limited to 'arg_picker/src/parselib/single_matcher.rs')
-rw-r--r--arg_picker/src/parselib/single_matcher.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/arg_picker/src/parselib/single_matcher.rs b/arg_picker/src/parselib/single_matcher.rs
index 25c4741..d7cf6a4 100644
--- a/arg_picker/src/parselib/single_matcher.rs
+++ b/arg_picker/src/parselib/single_matcher.rs
@@ -18,12 +18,11 @@ impl SingleMatcher {
/// For named args, only complete pairs (flag + value) are kept.
/// Flag occurrences without a following value or inline separator
/// are dropped so they remain available for other matchers.
- #[inline(always)]
+ #[inline]
+ #[must_use]
pub fn tag(ctx: TagPhaseContext) -> Vec<usize> {
if ctx.arg_info.positional {
- PositionalMatcher::match_one(ctx.into())
- .map(|i| vec![i])
- .unwrap_or_default()
+ PositionalMatcher::match_one(ctx.into()).map_or_else(Vec::new, |i| vec![i])
} else {
let args = ctx.args;
let positions = ArgMatcher::match_all(ctx.into());