From 09271676b6989c7bae6c3ecb36e9831339d8dbd7 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Thu, 20 Jan 2022 13:46:51 +0100 Subject: [PATCH] Fixed ownership of Screen borrow for Console --- ctru-rs/src/console.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index a25c2ab..ef71f78 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -8,21 +8,21 @@ use crate::gfx::Screen; pub struct Console<'screen> { context: Box, - _screen: PhantomData<&'screen ()>, + _screen: Ref<'screen, dyn Screen>, } impl<'screen> Console<'screen> { /// Initialize a console on the chosen screen, overwriting whatever was on the screen /// previously (including other consoles). The new console is automatically selected for /// printing. - pub fn init(screen: Ref<'screen, impl Screen>) -> Self { + pub fn init(screen: Ref<'screen, dyn Screen>) -> Self { let mut context = Box::new(PrintConsole::default()); unsafe { consoleInit(screen.as_raw(), context.as_mut()) }; Console { context, - _screen: PhantomData, + _screen: screen, } }