From fdd26053228593162fd5c41df9cfbc45d0c731b9 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 14 Jul 2026 19:43:56 +0800 Subject: feat: add lifetime-bound pickable support and refine type constraints --- mingling_picker/src/picker/parse.rs | 2 +- mingling_picker/src/picker/patterns.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'mingling_picker/src/picker') diff --git a/mingling_picker/src/picker/parse.rs b/mingling_picker/src/picker/parse.rs index defbcbf..f69e078 100644 --- a/mingling_picker/src/picker/parse.rs +++ b/mingling_picker/src/picker/parse.rs @@ -7,7 +7,7 @@ internal_repeat!(1..=32 => { internal_repeat!(1..=32 => { impl<'a, (T$,+)> PickerPattern$<'a, (T$,+)> - where (T$: Pickable + Default,+) + where (T$: Pickable<'a> + Default,+) { #[allow(clippy::type_complexity)] pub fn parse(self) -> PickerResult<((T$,+))> { diff --git a/mingling_picker/src/picker/patterns.rs b/mingling_picker/src/picker/patterns.rs index a33860b..b12f151 100644 --- a/mingling_picker/src/picker/patterns.rs +++ b/mingling_picker/src/picker/patterns.rs @@ -5,7 +5,7 @@ use crate::{Pickable, Picker, PickerArgs, PickerFlag, PickerResult}; internal_repeat!(1..=32 => { #[doc(hidden)] pub struct PickerPattern$<'a, (T$,+)> - where (T$: Pickable + Default,+) + where (T$: Pickable<'a> + Default,+) { pub args: PickerArgs<'a>, ( @@ -19,7 +19,7 @@ internal_repeat!(1..=32 => { internal_repeat!(1..=32 => { impl<'a, (T$,+)> PickerPattern$<'a, (T$,+)> - where (T$: Pickable + Default,+) + where (T$: Pickable<'a> + Default,+) { /// Sets a default value provider for this flag. /// @@ -70,7 +70,7 @@ internal_repeat!(1..=32 => { internal_repeat!(1..32 => { impl<'a, (T$,+)> PickerPattern$<'a, (T$,+)> - where (T$: Pickable + Default,+) + where (T$: Pickable<'a> + Default,+) { #[allow(clippy::type_complexity)] /// Adds a new flag to the picking chain, returning a new `PickerPattern` with one more type parameter. @@ -80,7 +80,7 @@ internal_repeat!(1..32 => { /// The new flag's result is initially `Unparsed`. pub fn pick(self, flag: &'a PickerFlag<'a, N>) -> PickerPattern$+<'a, (T$,+), N> where - N: Pickable + Default, + N: Pickable<'a> + Default, { PickerPattern$+ { // Args @@ -111,7 +111,7 @@ impl<'a> Picker<'a> { /// The result is initially `Unparsed`. pub fn pick(self, flag: &'a PickerFlag<'a, N>) -> PickerPattern1<'a, N> where - N: Pickable + Default, + N: Pickable<'a> + Default, { PickerPattern1 { args: self.args, -- cgit