diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-08-10 16:14:27 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-08-10 16:14:27 +0800 |
| commit | 49d53af58f249370553ea5f5af20d4dab80861aa (patch) | |
| tree | 5b97e7780aae7f0f5a0e2ee1ec5aab681392259b /examples/example-panic-unwind/src/main.rs | |
| parent | 7419eb26bfa71fecfd72af88edcffd61c0d19f95 (diff) | |
feat(example): use PanicSilence enum in panic unwind example
Diffstat (limited to 'examples/example-panic-unwind/src/main.rs')
| -rw-r--r-- | examples/example-panic-unwind/src/main.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/example-panic-unwind/src/main.rs b/examples/example-panic-unwind/src/main.rs index d5f746f..5d34275 100644 --- a/examples/example-panic-unwind/src/main.rs +++ b/examples/example-panic-unwind/src/main.rs @@ -15,6 +15,7 @@ //! OhMyGod //! ``` +use mingling::PanicSilence; use mingling::{hook::ProgramHook, prelude::*}; use std::io::Write; @@ -27,7 +28,7 @@ fn main() { // --------- IMPORTANT --------- // Enable silence_panic to suppress automatic Panic output - program.stdout_setting.silence_panic = true; + program.stdout_setting.silence_panic = PanicSilence::Silence; // Define a hook to output &ProgramPanic when a Panic occurs program.with_hook( @@ -52,7 +53,6 @@ fn handle_panic(prev: EntryPanic) -> Next { } /// Renders the message when no panic occurs. -/// Renders the message when no panic occurs. #[renderer] pub fn render(_: NotPanic) -> RenderResult { let mut render_result = RenderResult::new(); |
