aboutsummaryrefslogtreecommitdiff
path: root/mingling_picker/src/picker/patterns.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-07-14 19:43:56 +0800
committer魏曹先生 <1992414357@qq.com>2026-07-14 19:51:19 +0800
commitfdd26053228593162fd5c41df9cfbc45d0c731b9 (patch)
treec8782756a80d8fadf681ead52b4e512d4a1b2a9d /mingling_picker/src/picker/patterns.rs
parent538516a2104edba2c35b1f4ce40ec5a25589b62b (diff)
feat: add lifetime-bound pickable support and refine type constraints
Diffstat (limited to 'mingling_picker/src/picker/patterns.rs')
-rw-r--r--mingling_picker/src/picker/patterns.rs10
1 files changed, 5 insertions, 5 deletions
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<N>(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<N>(self, flag: &'a PickerFlag<'a, N>) -> PickerPattern1<'a, N>
where
- N: Pickable + Default,
+ N: Pickable<'a> + Default,
{
PickerPattern1 {
args: self.args,