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. 8
      ctru-rs/examples/gfx_wide_mode.rs
  2. 11
      ctru-rs/src/services/fs.rs
  3. 4
      ctru-rs/src/services/mod.rs

8
ctru-rs/examples/gfx_wide_mode.rs

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

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

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

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

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

Loading…
Cancel
Save