Browse Source

Fixed nits

pull/149/head
Andrea Ciliberti 12 months ago
parent
commit
a727feb11c
  1. 2
      ctru-rs/examples/file-explorer.rs
  2. 3
      ctru-rs/src/applets/mii_selector.rs
  3. 7
      ctru-rs/src/applets/swkbd.rs

2
ctru-rs/examples/file-explorer.rs

@ -165,7 +165,7 @@ impl<'a> FileExplorer<'a> { @@ -165,7 +165,7 @@ impl<'a> FileExplorer<'a> {
fn get_input_and_run(&mut self, action: impl FnOnce(&mut Self, String)) {
let mut keyboard = SoftwareKeyboard::default();
match keyboard.get_string(2048, &self.apt, &self.gfx) {
match keyboard.get_string(2048, self.apt, self.gfx) {
Ok((path, Button::Right)) => {
// Clicked "OK".
action(self, path);

3
ctru-rs/src/applets/mii_selector.rs

@ -281,8 +281,7 @@ impl MiiSelector { @@ -281,8 +281,7 @@ impl MiiSelector {
/// # }
/// ```
#[doc(alias = "miiSelectorLaunch")]
#[allow(unused_variables)]
pub fn launch(&mut self, apt: &Apt, gfx: &Gfx) -> Result<Selection, Error> {
pub fn launch(&mut self, _apt: &Apt, _gfx: &Gfx) -> Result<Selection, Error> {
let mut return_val = Box::<ctru_sys::MiiSelectorReturn>::default();
unsafe { ctru_sys::miiSelectorLaunch(self.config.as_mut(), return_val.as_mut()) }

7
ctru-rs/src/applets/swkbd.rs

@ -310,8 +310,7 @@ impl SoftwareKeyboard { @@ -310,8 +310,7 @@ impl SoftwareKeyboard {
/// # }
/// ```
#[doc(alias = "swkbdInputText")]
#[allow(unused_variables)]
pub fn write_exact(&mut self, buf: &mut [u8], apt: &Apt, gfx: &Gfx) -> Result<Button, Error> {
pub fn write_exact(&mut self, buf: &mut [u8], _apt: &Apt, _gfx: &Gfx) -> Result<Button, Error> {
unsafe {
match ctru_sys::swkbdInputText(self.state.as_mut(), buf.as_mut_ptr(), buf.len()) {
ctru_sys::SWKBD_BUTTON_NONE => Err(self.state.result.into()),
@ -407,7 +406,7 @@ impl SoftwareKeyboard { @@ -407,7 +406,7 @@ impl SoftwareKeyboard {
where
F: FnOnce(&str) -> (CallbackResult, Option<CString>),
{
let closure = Box::from_raw(user as *mut Box<F>);
let closure: Box<Box<F>> = Box::from_raw(user.cast());
let text = CStr::from_ptr(text);
let text_slice: &str = text.to_str().unwrap();
@ -691,7 +690,7 @@ impl ParentalLock { @@ -691,7 +690,7 @@ impl ParentalLock {
#[allow(unused_variables)]
pub fn launch(&mut self, apt: &Apt, gfx: &Gfx) -> Result<(), Error> {
unsafe {
let mut buf = [0; 10];
let mut buf = [0; 0];
ctru_sys::swkbdInputText(self.state.as_mut(), buf.as_mut_ptr(), 10);
let e = self.state.result.into();

Loading…
Cancel
Save