From 082d9933b98ffe621ef5f106a32ac1a86db89c39 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Fri, 31 Mar 2023 16:30:15 +0200 Subject: [PATCH] Fixed file-explorer example --- ctru-rs/examples/file-explorer.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ctru-rs/examples/file-explorer.rs b/ctru-rs/examples/file-explorer.rs index 88de947..2e4e254 100644 --- a/ctru-rs/examples/file-explorer.rs +++ b/ctru-rs/examples/file-explorer.rs @@ -162,17 +162,16 @@ impl<'a> FileExplorer<'a> { fn get_input_and_run(&mut self, action: impl FnOnce(&mut Self, String)) { let mut keyboard = Swkbd::default(); - let mut new_path_str = String::new(); - match keyboard.get_utf8(&mut new_path_str) { - Ok(Button::Right) => { + match keyboard.write_to_string() { + Ok((path, Button::Right)) => { // Clicked "OK" - action(self, new_path_str); + action(self, path); } - Ok(Button::Left) => { + Ok((_, Button::Left)) => { // Clicked "Cancel" } - Ok(Button::Middle) => { + Ok((_, Button::Middle)) => { // This button wasn't shown unreachable!() }