diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-05-19 22:48:23 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-05-19 22:48:23 +0800 |
| commit | 39d66182f0290bacc10886c2659874bd9edc2d4b (patch) | |
| tree | 7b0e9463575a8350cd5a61bd0d02c9bada892b7f /examples/example-exit-code/src | |
| parent | bd4b09b06181093c95e865b04d4a9cdda7dd0728 (diff) | |
Add `empty_result!` macro and `REPL` resource, improve examples
Diffstat (limited to 'examples/example-exit-code/src')
| -rw-r--r-- | examples/example-exit-code/src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/example-exit-code/src/main.rs b/examples/example-exit-code/src/main.rs index 028692e..39428e9 100644 --- a/examples/example-exit-code/src/main.rs +++ b/examples/example-exit-code/src/main.rs @@ -13,7 +13,7 @@ use mingling::prelude::*; use mingling::{ - res::{exit_code, update_exit_code}, + res::{ExitCode, exit_code}, setup::ExitCodeSetup, }; @@ -28,8 +28,8 @@ dispatcher!("error", ErrorCommand => ErrorEntry); pack!(ResultError = ()); #[chain] -fn handle_error_entry(_prev: ErrorEntry) -> Next { - update_exit_code::<ThisProgram>(1); +fn handle_error_entry(_prev: ErrorEntry, ec: &mut ExitCode) -> Next { + ec.exit_code = 1; return ResultError::default(); } |
