diff options
| author | Weicao-CatilGrass <1992414357@qq.com> | 2026-05-31 02:42:52 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-05-31 17:19:20 +0800 |
| commit | 2aa7bda3cb21ce6c052b82e08bcab79a625d04f2 (patch) | |
| tree | f10b89007fc67ca1a948f34abe6869b49296b932 /examples/example-panic-unwind/src/main.rs | |
| parent | 3aa409a55e4f2f0ab41b0949cc06eb13c2da4a43 (diff) | |
Enhance code quality across the entire codebase
Diffstat (limited to 'examples/example-panic-unwind/src/main.rs')
| -rw-r--r-- | examples/example-panic-unwind/src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/example-panic-unwind/src/main.rs b/examples/example-panic-unwind/src/main.rs index 18cf4d6..bb25541 100644 --- a/examples/example-panic-unwind/src/main.rs +++ b/examples/example-panic-unwind/src/main.rs @@ -29,11 +29,10 @@ fn main() { program.stdout_setting.silence_panic = true; // Define a hook to output &ProgramPanic when a Panic occurs - program - .with_hook(ProgramHook::empty().on_exec_panic(|info| println!("Program panic: {}", info))); + program.with_hook(ProgramHook::empty().on_exec_panic(|info| println!("Program panic: {info}"))); // --------- IMPORTANT --------- - program.exec(); + let _ = program.exec(); } #[chain] @@ -48,6 +47,7 @@ fn handle_panic(prev: EntryPanic) -> Next { } } +/// Renders the message when no panic occurs. #[renderer] fn render(_: NotPanic) { r_println!("Program not panic"); |
