diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-19 00:22:23 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-19 00:27:16 +0800 |
| commit | 5e460470f6ea2ce31a403b6e936ec2fe8f45312a (patch) | |
| tree | ec1d675d9544b31ab9382ebbd10bbeda43923cc8 /arg_picker/src/picker.rs | |
| parent | 9b4cffd48482481691f782e74a4726294043bc57 (diff) | |
feat: migrate mingling-specific picker code into mingling crate
BREAKING CHANGE: Remove `mingling_support` feature from arg-picker
crate. The
`EntryPicker` trait and `corebind` module are now part of the mingling
crate
directly, and `build_pattern1` is now a public method.
Diffstat (limited to 'arg_picker/src/picker.rs')
| -rw-r--r-- | arg_picker/src/picker.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/arg_picker/src/picker.rs b/arg_picker/src/picker.rs index 7a60e16..f31a5b6 100644 --- a/arg_picker/src/picker.rs +++ b/arg_picker/src/picker.rs @@ -158,6 +158,15 @@ impl<'a> IntoIterator for &'a PickerArgs<'a> { } } +impl<'a, Route> From<PickerArgs<'a>> for Picker<'a, Route> { + fn from(args: PickerArgs<'a>) -> Self { + Picker { + route_phantom: PhantomData, + args, + } + } +} + impl<'a, Route> From<&'a [&'a str]> for Picker<'a, Route> { fn from(value: &'a [&'a str]) -> Self { Picker { @@ -428,10 +437,9 @@ impl<'a> IntoPicker<'a> for Vec<String> { } } -// Private helper: shared construction logic for `PickerPattern1`. -// Both `Picker::pick` and `IntoPicker::pick` delegate to this. impl<'a, Route> Picker<'a, Route> { - pub(crate) fn build_pattern1<N>( + /// Build the PickerPattern via Arguments + pub fn build_pattern1<N>( args: PickerArgs<'a>, arg: &'a PickerArg<'a, N>, error_route: Option<Route>, |
