From 526f7cc25e1bfeb39c934dc9ef367d3bc8ee493c Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Fri, 21 Jan 2022 14:06:19 +0100 Subject: [PATCH] Console requires mutable Screen --- ctru-rs/src/console.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index 64e9be7..8763eb2 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -1,4 +1,4 @@ -use std::cell::Ref; +use std::cell::RefMut; use std::default::Default; use ctru_sys::{consoleClear, consoleInit, consoleSelect, consoleSetWindow, PrintConsole}; @@ -7,21 +7,21 @@ use crate::gfx::Screen; pub struct Console<'screen> { context: Box, - screen: Ref<'screen, dyn Screen>, + screen: RefMut<'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, dyn Screen>) -> Self { + pub fn init(screen: RefMut<'screen, dyn Screen>) -> Self { let mut context = Box::new(PrintConsole::default()); unsafe { consoleInit(screen.as_raw(), context.as_mut()) }; Console { context, - _screen: screen, + screen, } }