diff options
| author | Weicao-CatilGrass <1992414357@qq.com> | 2026-05-13 07:34:45 +0800 |
|---|---|---|
| committer | Weicao-CatilGrass <1992414357@qq.com> | 2026-05-13 07:40:00 +0800 |
| commit | 2588933ebc500f439ebef075fef1064b0c5f0bcb (patch) | |
| tree | 595e55d7aa634bf7f730acaab7bcf243191c519a /examples/example-exit-code/src | |
| parent | 566b43cc15fc8a0bc7f962e05908486dbf53a7d0 (diff) | |
Add convenient `update_exit_code` and `exit_code` helper functions
Diffstat (limited to 'examples/example-exit-code/src')
| -rw-r--r-- | examples/example-exit-code/src/main.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/example-exit-code/src/main.rs b/examples/example-exit-code/src/main.rs index f138fb3..f62ad22 100644 --- a/examples/example-exit-code/src/main.rs +++ b/examples/example-exit-code/src/main.rs @@ -13,9 +13,8 @@ use mingling::{ macros::{chain, dispatcher, gen_program, pack, r_println, renderer}, - res::ExitCode, + res::update_exit_code, setup::ExitCodeSetup, - this, }; fn main() { @@ -30,7 +29,7 @@ pack!(ResultError = ()); #[chain] fn handle_error_entry(_prev: ErrorEntry) -> NextProcess { - this::<ThisProgram>().modify_res(|r: &mut ExitCode| r.exit_code = 1); + update_exit_code::<ThisProgram>(1); return ResultError::default(); } |
