From e5b3977ef7f56bcf69063ad973239485d629ea97 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 18 Feb 2023 15:34:16 +0100 Subject: [PATCH] fmt and clippy --- ctru-rs/src/error.rs | 6 +++++- ctru-rs/src/services/cam.rs | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ctru-rs/src/error.rs b/ctru-rs/src/error.rs index 3231c4e..33eecf6 100644 --- a/ctru-rs/src/error.rs +++ b/ctru-rs/src/error.rs @@ -103,7 +103,11 @@ impl fmt::Debug for Error { Self::Libc(err) => f.debug_tuple("Libc").field(err).finish(), Self::ServiceAlreadyActive => f.debug_tuple("ServiceAlreadyActive").finish(), Self::OutputAlreadyRedirected => f.debug_tuple("OutputAlreadyRedirected").finish(), - Self::BufferTooShort(provided, wanted) => f.debug_tuple("BufferTooShort").field(provided).field(wanted).finish(), + Self::BufferTooShort(provided, wanted) => f + .debug_tuple("BufferTooShort") + .field(provided) + .field(wanted) + .finish(), } } } diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 4e222e0..26bbede 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -742,8 +742,8 @@ pub trait Camera { }; let screen_size: usize = usize::from(width) * usize::from(height) * 2; - if buffer.len() < screen_size as usize { - return Err(Error::BufferTooShort(buffer.len(), screen_size)) + if buffer.len() < screen_size { + return Err(Error::BufferTooShort(buffer.len(), screen_size)); } unsafe {