From 28a8b08f09ca82f155a662d0cdbdb7171d7f5b39 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 19 Nov 2023 18:42:14 +0100 Subject: [PATCH] Fmt and docs lints --- ctru-rs/src/services/cam.rs | 18 ++++++------------ ctru-rs/src/services/hid.rs | 4 ++-- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 0e31d13..a4c799d 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -239,10 +239,7 @@ pub enum ShutterSound { pub enum Trimming { /// Trimming configuration relatively to the center of the image. #[allow(missing_docs)] - Centered{ - width: i16, - height: i16, - }, + Centered { width: i16, height: i16 }, /// Trimming disabled. Off, } @@ -660,7 +657,7 @@ pub trait Camera: private::ConfigurableCamera { /// ``` fn final_view_size(&self) -> (i16, i16) { match self.trimming() { - Trimming::Centered{width, height} => (width, height), + Trimming::Centered { width, height } => (width, height), Trimming::Off => self.view_size().into(), } } @@ -681,7 +678,7 @@ pub trait Camera: private::ConfigurableCamera { #[doc(alias = "CAMU_SetTrimming")] fn set_trimming(&mut self, trimming: Trimming) -> crate::Result<()> { match trimming { - Trimming::Centered{width, height} => unsafe { + Trimming::Centered { width, height } => unsafe { let view_size: (i16, i16) = self.view_size().into(); let mut trim_size: (i16, i16) = (width, height); @@ -1103,17 +1100,14 @@ impl Trimming { /// Create a new [`Trimming`] configuration using width and height centered to the original image. /// /// # Panics - /// + /// /// This function will panic if the pixel area of the new configuration (`width * height`) /// is not a multiple of 128. pub fn new_centered(width: i16, height: i16) -> Self { // Pixel area must be a multiple of 128. assert!((width * height) % 128 == 0); - - Self::Centered { - width, - height, - } + + Self::Centered { width, height } } /// Create a new [`Trimming`] configuration using a standard view size centered to the original image. diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index 36588b0..10d89c4 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -92,7 +92,7 @@ pub enum Error { /// Representation of the acceleration vector read by the accelerometer. /// -/// Have a look at [`Hid::enable_accelerometer()`] for more information. +/// Have a look at [`Hid::set_accelerometer()`] for more information. #[allow(missing_docs)] #[derive(Default, Copy, Clone, Debug, PartialEq, Eq)] pub struct Acceleration { @@ -103,7 +103,7 @@ pub struct Acceleration { /// Representation of the angular rate read by the gyroscope. /// -/// Have a look at [`Hid::enable_gyroscope())`] for more information. +/// Have a look at [`Hid::set_gyroscope()`] for more information. #[allow(missing_docs)] #[derive(Default, Copy, Clone, Debug, PartialEq, Eq)] pub struct AngularRate {