diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-06-22 23:59:31 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-06-22 23:59:31 +0800 |
| commit | 443ffe86485519a218997955335cde142733f88f (patch) | |
| tree | ef331749338c8653ac8a241bfd1cf83cd0683468 /examples/example-argument-parse | |
| parent | 31b5abfc96013309530025b751293c7de916dcf3 (diff) | |
Make route! macro auto-convert error types
`route!()` now calls `Groupped::to_chain()` on the error branch,
removing the need for callers to pre-convert with `.to_chain()` or
`.to_render()`.
Diffstat (limited to 'examples/example-argument-parse')
| -rw-r--r-- | examples/example-argument-parse/src/main.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/example-argument-parse/src/main.rs b/examples/example-argument-parse/src/main.rs index 316e52f..4929b7c 100644 --- a/examples/example-argument-parse/src/main.rs +++ b/examples/example-argument-parse/src/main.rs @@ -59,7 +59,7 @@ fn handle_strict_transfer_parse(args: EntryStrictTransfer) -> Next { .pick::<bool>(["--dir", "-D"]) .pick_or::<usize>("--size", 1024 * 1024_usize) // Finally parse the positional argument; if not found, route to `ErrorNoNameProvided` - .pick_or_route::<String, _>((), ErrorNoNameProvided::default().to_chain()) + .pick_or_route::<String, _>((), ErrorNoNameProvided::default()) .after(|str| str.trim().replace(' ', "")) .unpack() } |
