aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-05-01 23:02:40 +0800
committer魏曹先生 <1992414357@qq.com>2026-05-01 23:02:40 +0800
commit0e7a622f40323f0b7c0004a429201518b9e088e7 (patch)
tree2b4ceefa90662cc1ec0cc98b8ef67bcaf2116dd6
parent5c5b828fcb75aef5708ff95ea1f7994f86bef5b4 (diff)
Fix README examples to use AsPicker trait instead of Picker
-rw-r--r--CHANGELOG.md2
-rw-r--r--README.md8
-rw-r--r--docs/README.md8
3 files changed, 7 insertions, 11 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f66dbd1..6bb3772 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -36,7 +36,6 @@ struct YourCommandEntry {
5. **\[core\]** Added function `dispatch_args_dynamic` to `Program`
6. **\[core\]** Impl `std::io::Write` trait for `RenderResult`
7. **\[core\]** Added Help system, which allows binding an event for `--help` to an `Entry` via the `help!` macro
-8. **\[core\]** Added the function `build_comp_script_to` to the `mingling::build` module: supports outputting completion scripts precisely to a specified directory
```rust
#[help]
@@ -45,6 +44,7 @@ fn your_command_help(_prev: YourEntry) {
}
```
+8. **\[core\]** Added the function `build_comp_script_to` to the `mingling::build` module: supports outputting completion scripts precisely to a specified directory
9. **\[macros\]** Added the `route!` macro, which allows quick error routing within the `chain!` function. Usage is as follows:
```rust
diff --git a/README.md b/README.md
index 5e5809f..3896613 100644
--- a/README.md
+++ b/README.md
@@ -114,7 +114,7 @@ use mingling::{
macros::{
chain, completion, dispatcher, gen_program, help, pack, r_println, renderer, suggest,
},
- parser::Picker,
+ parser::AsPicker,
setup::BasicProgramSetup,
};
@@ -161,10 +161,8 @@ fn comp_greet_command(ctx: &ShellContext) -> Suggest {
// Define chain, parsing `GreetEntry` into `StateGreeting`
#[chain]
fn parse_name_to_greet(prev: GreetEntry) -> NextProcess {
- let state_greeting: StateGreeting = Picker::new(prev.inner)
- .pick_or::<String>((), "World")
- .unpack_directly()
- .into();
+ let state_greeting: StateGreeting =
+ prev.pick_or::<String>((), "World").unpack().into();
state_greeting
}
diff --git a/docs/README.md b/docs/README.md
index 6082508..e4de81c 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -114,7 +114,7 @@ use mingling::{
macros::{
chain, completion, dispatcher, gen_program, help, pack, r_println, renderer, suggest,
},
- parser::Picker,
+ parser::AsPicker,
setup::BasicProgramSetup,
};
@@ -161,10 +161,8 @@ fn comp_greet_command(ctx: &ShellContext) -> Suggest {
// Define chain, parsing `GreetEntry` into `StateGreeting`
#[chain]
fn parse_name_to_greet(prev: GreetEntry) -> NextProcess {
- let state_greeting: StateGreeting = Picker::<()>::new(prev.inner)
- .pick_or::<String>((), "World")
- .unpack_directly()
- .into();
+ let state_greeting: StateGreeting =
+ prev.pick_or::<String>((), "World").unpack().into();
state_greeting
}