Browse Source

fmt and clippy

pull/94/head
Andrea Ciliberti 2 years ago
parent
commit
e5b3977ef7
  1. 6
      ctru-rs/src/error.rs
  2. 4
      ctru-rs/src/services/cam.rs

6
ctru-rs/src/error.rs

@ -103,7 +103,11 @@ impl fmt::Debug for Error { @@ -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(),
}
}
}

4
ctru-rs/src/services/cam.rs

@ -742,8 +742,8 @@ pub trait Camera { @@ -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 {

Loading…
Cancel
Save