diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-03-31 08:54:51 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-03-31 08:54:51 +0800 |
| commit | 537a815efaa3fb85435ca3e500f870d448b17337 (patch) | |
| tree | 5897d9b69edf9cfdc50210b7d7d2fe57461126c6 /mingling/src/parser/picker/builtin.rs | |
| parent | 39f4f34cfdf940e1c74184edb3387ef8900ba4b4 (diff) | |
Add Argument type to picker builtins and expose Picker
- Add `#[derive(Debug, Default)]` to `Argument` struct
- Add `dump_remains` method to `Argument`
- Remove `#[doc(hidden)]` from `Picker` struct
- Implement `Pickable` for `Argument` to allow consuming remaining args
Diffstat (limited to 'mingling/src/parser/picker/builtin.rs')
| -rw-r--r-- | mingling/src/parser/picker/builtin.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/mingling/src/parser/picker/builtin.rs b/mingling/src/parser/picker/builtin.rs index 0b1ce08..9184813 100644 --- a/mingling/src/parser/picker/builtin.rs +++ b/mingling/src/parser/picker/builtin.rs @@ -1,6 +1,6 @@ use size::Size; -use crate::parser::Pickable; +use crate::parser::{Argument, Pickable}; impl Pickable for String { type Output = String; @@ -51,3 +51,14 @@ impl Pickable for usize { } } } + +impl Pickable for Argument { + type Output = Argument; + + fn pick( + args: &mut crate::parser::Argument, + _flag: mingling_core::Flag, + ) -> Option<Self::Output> { + Some(args.dump_remains().into()) + } +} |
