From 49d53af58f249370553ea5f5af20d4dab80861aa Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 10 Aug 2026 16:14:27 +0800 Subject: feat(example): use PanicSilence enum in panic unwind example --- examples/example-panic-unwind/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') 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( @@ -51,7 +52,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 { -- cgit