diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-17 03:00:27 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-17 03:00:27 +0800 |
| commit | b29c702af03fee9fe724108696f92e5b602e0d7a (patch) | |
| tree | c7d20d7af08e3cca5f1903f93a8456276e43d5ab | |
| parent | f05a719efe572660aa2ca30bb490177bdace990c (diff) | |
fix(vec_until): reorganize imports and clean up formatting
| -rw-r--r-- | mingling_picker/src/value/vec_until.rs | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/mingling_picker/src/value/vec_until.rs b/mingling_picker/src/value/vec_until.rs index b1b49b8..1b79641 100644 --- a/mingling_picker/src/value/vec_until.rs +++ b/mingling_picker/src/value/vec_until.rs @@ -2,10 +2,10 @@ use std::marker::PhantomData; use std::ops::{Deref, DerefMut}; use crate::{ + BoundaryCheck, MultiPickableWithBoundary, Pickable, PickerArg, PickerArgAttr, PickerArgResult, + SinglePickable, TagPhaseContext, matcher_needed::Matcher, parselib::{MultiArgMatcher, ParserStyle}, - BoundaryCheck, MultiPickableWithBoundary, Pickable, PickerArg, PickerArgAttr, - PickerArgResult, SinglePickable, TagPhaseContext, }; /// A `Vec`-like container that stops collecting when [`BoundaryCheck`] @@ -28,7 +28,10 @@ impl<T> VecUntil<T> { impl<T> From<Vec<T>> for VecUntil<T> { fn from(v: Vec<T>) -> Self { - VecUntil { inner: v, _marker: PhantomData } + VecUntil { + inner: v, + _marker: PhantomData, + } } } @@ -51,9 +54,7 @@ impl<T> DerefMut for VecUntil<T> { } } -// ============================================================ // MultiPickableWithBoundary impl -// ============================================================ impl<T> MultiPickableWithBoundary for VecUntil<T> where @@ -70,13 +71,14 @@ where PickerArgResult::Unparsed => {} } } - PickerArgResult::Parsed(VecUntil { inner, _marker: PhantomData }) + PickerArgResult::Parsed(VecUntil { + inner, + _marker: PhantomData, + }) } } -// ============================================================ // Pickable impl -// ============================================================ impl<'a, T> Pickable<'a> for VecUntil<T> where @@ -101,10 +103,10 @@ where let mut cut = start; for &idx in &positions[start..] { - if let Some(raw) = args.get(idx) { - if T::check_boundary(raw) { - break; - } + if let Some(raw) = args.get(idx) + && T::check_boundary(raw) + { + break; } cut += 1; } |
