aboutsummaryrefslogtreecommitdiff
path: root/examples/example-exit-code/src/main.rs
diff options
context:
space:
mode:
authorWeicao-CatilGrass <1992414357@qq.com>2026-05-13 07:34:45 +0800
committerWeicao-CatilGrass <1992414357@qq.com>2026-05-13 07:40:00 +0800
commit2588933ebc500f439ebef075fef1064b0c5f0bcb (patch)
tree595e55d7aa634bf7f730acaab7bcf243191c519a /examples/example-exit-code/src/main.rs
parent566b43cc15fc8a0bc7f962e05908486dbf53a7d0 (diff)
Add convenient `update_exit_code` and `exit_code` helper functions
Diffstat (limited to 'examples/example-exit-code/src/main.rs')
-rw-r--r--examples/example-exit-code/src/main.rs5
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();
}