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/value/vec_until.rs | |
| parent | 03b487f0f93ac32835149d4c1a0fb420341134f8 (diff) | |
style: satisfy clippy pedantic and nursery lints
Diffstat (limited to 'arg_picker/src/value/vec_until.rs')
| -rw-r--r-- | arg_picker/src/value/vec_until.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arg_picker/src/value/vec_until.rs b/arg_picker/src/value/vec_until.rs index 04d87ce..6394cbf 100644 --- a/arg_picker/src/value/vec_until.rs +++ b/arg_picker/src/value/vec_until.rs @@ -22,6 +22,7 @@ pub struct VecUntil<T> { impl<T> VecUntil<T> { /// Consumes `self` and returns the underlying [`Vec<T>`]. + #[must_use] pub fn into_inner(self) -> Vec<T> { self.inner } @@ -29,7 +30,7 @@ impl<T> VecUntil<T> { impl<T> From<Vec<T>> for VecUntil<T> { fn from(v: Vec<T>) -> Self { - VecUntil { + Self { inner: v, _marker: PhantomData, } @@ -72,7 +73,7 @@ where PickerArgResult::Unparsed => {} } } - PickerArgResult::Parsed(VecUntil { + PickerArgResult::Parsed(Self { inner, _marker: PhantomData, }) @@ -97,7 +98,7 @@ where return positions; } - let start = if is_positional { 0 } else { 1 }; + let start = usize::from(!is_positional); if start >= positions.len() { return positions; } @@ -118,7 +119,7 @@ where fn pick(raw_strs: &[&str]) -> PickerArgResult<Self> { let strs = strip_flag(raw_strs); let owned: Vec<String> = strs.iter().map(|&s| s.to_string()).collect(); - <VecUntil<T> as MultiPickableWithBoundary>::pick_multi(owned) + <Self as MultiPickableWithBoundary>::pick_multi(owned) } } |
