From 684bfb3251801757d245c80c15c95676239f0ca6 Mon Sep 17 00:00:00 2001 From: Fenrir Date: Wed, 14 Feb 2024 16:35:52 -0700 Subject: [PATCH] Use addr_of_mut! when referring to EMPTY_CONSOLE --- ctru-rs/src/console.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index cb98840..9fedd2a 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -143,7 +143,7 @@ impl<'screen> Console<'screen> { /// ``` pub fn exists() -> bool { unsafe { - let current_console = ctru_sys::consoleSelect(&mut EMPTY_CONSOLE); + let current_console = ctru_sys::consoleSelect(std::ptr::addr_of_mut!(EMPTY_CONSOLE)); let res = (*current_console).consoleInitialised; @@ -364,7 +364,7 @@ impl Drop for Console<'_> { // the screen, but it won't crash either. // Get the current console by replacing it with an empty one. - let current_console = ctru_sys::consoleSelect(&mut EMPTY_CONSOLE); + let current_console = ctru_sys::consoleSelect(std::ptr::addr_of_mut!(EMPTY_CONSOLE)); if std::ptr::eq(current_console, &*self.context) { // Console dropped while selected. We just replaced it with the