From ffbe6604a68cc496f289553f04106185211fa2bc Mon Sep 17 00:00:00 2001 From: Fenrir Date: Sun, 25 Feb 2024 19:09:28 -0700 Subject: [PATCH] Improve docs for set_panic_hook --- ctru-rs/src/applets/error.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ctru-rs/src/applets/error.rs b/ctru-rs/src/applets/error.rs index d57af55..9bc66da 100644 --- a/ctru-rs/src/applets/error.rs +++ b/ctru-rs/src/applets/error.rs @@ -88,12 +88,16 @@ impl PopUp { } } -/// Sets a custom panic hook that uses the error applet to display panic messages. You can also choose to have the -/// previously registered panic hook called along with the error applet message, which can be useful if you want -/// to use input redirection to display panic messages over `3dslink` or `GDB`. +/// Sets a custom [panic hook](https://doc.rust-lang.org/std/panic/fn.set_hook.html) that uses the error applet to display panic messages. /// -/// If the `Gfx` service is not initialized during a panic, the error applet will not be displayed and the old +/// You can also choose to have the previously registered panic hook called along with the error applet message, which can be useful +/// if you want to use output redirection to display panic messages over `3dslink` or `GDB`. +/// +/// If the [`Gfx`] service is not initialized during a panic, the error applet will not be displayed and the old /// panic hook will be called. +/// +/// You can use [`std::panic::take_hook`](https://doc.rust-lang.org/std/panic/fn.take_hook.html) to unregister the panic hook +/// set by this function. pub fn set_panic_hook(call_old_hook: bool) { use crate::services::gfx::GFX_ACTIVE; use std::sync::TryLockError;