From d5ce31bf3b813db2087a5de4a95d5266b7e68cdb Mon Sep 17 00:00:00 2001 From: Steve Cook Date: Tue, 4 Oct 2022 11:31:17 -0400 Subject: [PATCH] Requested changes --- ctru-rs/src/services/cam.rs | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 414a3de..d8671ef 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -204,32 +204,24 @@ impl CamTrimmingParams { /// equal to the end coordinates. /// /// `x_start <= x_end && y_start <= y_end` - pub fn new( - x_start: i16, - y_start: i16, - x_end: i16, - y_end: i16, - ) -> Result { - if x_start > x_end || y_start > y_end { - Err(()) - } else { - Self { - x_start, - y_start, - x_end, - y_end, - } + pub fn new(x_start: i16, y_start: i16, x_end: i16, y_end: i16) -> CamTrimmingParams { + assert!(x_start <= x_end && y_start <= y_end); + Self { + x_start, + y_start, + x_end, + y_end, } } } /// Represents data used by the camera to calibrate image quality #[derive(Default)] -pub struct ImageQualityCalibrationData(ctru_sys::CAMU_ImageQualityCalibrationData); +pub struct ImageQualityCalibrationData(pub ctru_sys::CAMU_ImageQualityCalibrationData); /// Represents data used by the camera to calibrate image quality when using both outward cameras #[derive(Default)] -pub struct StereoCameraCalibrationData(ctru_sys::CAMU_StereoCameraCalibrationData); +pub struct StereoCameraCalibrationData(pub ctru_sys::CAMU_StereoCameraCalibrationData); /// Represents the camera on the inside of the 3DS #[non_exhaustive]