Browse Source

Fmt and clippy

pull/118/head
Andrea Ciliberti 2 years ago
parent
commit
ef074a66ad
  1. 7
      ctru-rs/examples/camera-image.rs
  2. 6
      ctru-rs/src/applets/mii_selector.rs
  3. 7
      ctru-rs/src/services/gfx.rs

7
ctru-rs/examples/camera-image.rs

@ -85,12 +85,7 @@ fn main() { @@ -85,12 +85,7 @@ fn main() {
cam.play_shutter_sound(ShutterSound::Normal)
.expect("Failed to play shutter sound");
rotate_image_to_screen(
&buf,
top_screen.raw_framebuffer().ptr,
WIDTH,
HEIGHT,
);
rotate_image_to_screen(&buf, top_screen.raw_framebuffer().ptr, WIDTH, HEIGHT);
// We will only flush the "camera" screen, since the other screen is handled by `Console`
top_screen.flush_buffer();

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

@ -155,6 +155,12 @@ impl MiiSelector { @@ -155,6 +155,12 @@ impl MiiSelector {
}
}
impl Default for MiiSelector {
fn default() -> Self {
Self::new()
}
}
impl From<ctru_sys::MiiSelectorReturn> for SelectionResult {
fn from(ret: ctru_sys::MiiSelectorReturn) -> Self {
let raw_mii_data = ret.mii;

7
ctru-rs/src/services/gfx.rs

@ -62,7 +62,12 @@ pub trait Screen: private::Sealed { @@ -62,7 +62,12 @@ pub trait Screen: private::Sealed {
let framebuffer = self.raw_framebuffer();
// Flush the data array. `self.raw_framebuffer` should get the correct parameters for all kinds of screens
unsafe { ctru_sys::GSPGPU_FlushDataCache(framebuffer.ptr.cast(), (framebuffer.height * framebuffer.width) as u32) };
unsafe {
ctru_sys::GSPGPU_FlushDataCache(
framebuffer.ptr.cast(),
(framebuffer.height * framebuffer.width) as u32,
)
};
}
/// Swaps the video buffers.

Loading…
Cancel
Save