diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-14 16:56:34 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-14 16:56:34 +0800 |
| commit | 561e35154e4d453fdc14a2664316c858323b0de7 (patch) | |
| tree | 000c164c185142e42ab0a35bd534a50bfc5d14bb /mingling_picker/src/picker | |
| parent | e630ae88cf57c3b4df77565ea1bc2460f4bfff86 (diff) | |
feat(picker): add default and post-processing hooks for flags
Diffstat (limited to 'mingling_picker/src/picker')
| -rw-r--r-- | mingling_picker/src/picker/patterns.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mingling_picker/src/picker/patterns.rs b/mingling_picker/src/picker/patterns.rs index 2501823..1a0bad7 100644 --- a/mingling_picker/src/picker/patterns.rs +++ b/mingling_picker/src/picker/patterns.rs @@ -10,6 +10,8 @@ internal_repeat!(1..=32 => { ( pub flag_$: &'a PickerFlag<'a, T$>, pub result_$: PickerResult<T$>, + pub default_$: Option<Box<dyn FnMut() -> T$>>, + pub post_$: Option<Box<dyn FnMut(T$) -> T$>>, +) } }); @@ -35,11 +37,15 @@ internal_repeat!(1..32 => { // Current flag_$+: flag, result_$+: PickerResult::Unparsed, + default_$+: None, + post_$+: None, // Prev ( flag_$: self.flag_$, result_$: self.result_$, + default_$: self.default_$, + post_$: self.post_$, +) } } @@ -59,6 +65,8 @@ impl<'a> Picker<'a> { args: self.args, flag_1: flag, result_1: PickerResult::Unparsed, + default_1: None, + post_1: None, } } } |
