Browse Source

Run rustfmt

pull/13/head
AzureMarker 3 years ago
parent
commit
e4b2e701b6
No known key found for this signature in database
GPG Key ID: 47A133F3BF9D03D3
  1. 6
      ctru-rs/examples/gfx_wide_mode.rs
  2. 11
      ctru-rs/src/services/fs.rs
  3. 4
      ctru-rs/src/services/mod.rs

6
ctru-rs/examples/gfx_wide_mode.rs

@ -1,10 +1,10 @@
extern crate ctru; extern crate ctru;
use ctru::console::Console; use ctru::console::Console;
use ctru::Gfx;
use ctru::gfx::Screen; use ctru::gfx::Screen;
use ctru::services::{Apt, Hid};
use ctru::services::hid::KeyPad; use ctru::services::hid::KeyPad;
use ctru::services::{Apt, Hid};
use ctru::Gfx;
fn main() { fn main() {
ctru::init(); ctru::init();
@ -19,7 +19,7 @@ fn main() {
hid.scan_input(); hid.scan_input();
if hid.keys_down().contains(KeyPad::KEY_START) { if hid.keys_down().contains(KeyPad::KEY_START) {
break break;
} }
if hid.keys_down().contains(KeyPad::KEY_A) { if hid.keys_down().contains(KeyPad::KEY_A) {

11
ctru-rs/src/services/fs.rs

@ -427,7 +427,10 @@ impl File {
crate::Error::from(r), crate::Error::from(r),
)) ))
} else { } else {
Ok(Metadata { attributes: 0, size }) Ok(Metadata {
attributes: 0,
size,
})
} }
} }
} }
@ -922,10 +925,8 @@ unsafe fn read_to_end_uninitialized(r: &mut dyn Read, buf: &mut Vec<u8>) -> IoRe
buf.reserve(1); buf.reserve(1);
} }
let buf_slice = slice::from_raw_parts_mut( let buf_slice =
buf.as_mut_ptr().add(buf.len()), slice::from_raw_parts_mut(buf.as_mut_ptr().add(buf.len()), buf.capacity() - buf.len());
buf.capacity() - buf.len(),
);
match r.read(buf_slice) { match r.read(buf_slice) {
Ok(0) => { Ok(0) => {

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

@ -1,10 +1,10 @@
pub mod apt; pub mod apt;
pub mod fs; pub mod fs;
pub mod hid;
pub mod gspgpu; pub mod gspgpu;
pub mod hid;
pub mod soc; pub mod soc;
pub mod sslc; pub mod sslc;
pub use self::hid::Hid;
pub use self::apt::Apt; pub use self::apt::Apt;
pub use self::hid::Hid;
pub use self::sslc::SslC; pub use self::sslc::SslC;

Loading…
Cancel
Save