Browse Source

Run cargo fix to make compatible with Rust 2021

pull/13/head
AzureMarker 3 years ago
parent
commit
a16234c4e1
No known key found for this signature in database
GPG Key ID: 47A133F3BF9D03D3
  1. 7
      ctru-rs/examples/buttons.rs
  2. 4
      ctru-rs/examples/hello-both-screens.rs
  3. 5
      ctru-rs/examples/hello-world.rs
  4. 6
      ctru-rs/examples/software-keyboard.rs
  5. 1
      ctru-rs/src/applets/swkbd.rs
  6. 6
      ctru-rs/src/lib.rs
  7. 5
      ctru-rs/src/services/fs.rs
  8. 2
      ctru-rs/src/services/hid.rs
  9. 2
      ctru-sys/src/lib.rs

7
ctru-rs/examples/buttons.rs

@ -1,7 +1,5 @@ @@ -1,7 +1,5 @@
extern crate ctru;
use ctru::gfx::Gfx;
use ctru::console::Console;
use ctru::gfx::Gfx;
use ctru::services::apt::Apt;
use ctru::services::hid::{Hid, KeyPad};
@ -29,7 +27,6 @@ fn main() { @@ -29,7 +27,6 @@ fn main() {
// We only want to print when the keys we're holding now are different
// from what they were on the previous frame
if keys != old_keys {
// Clear the screen
console.clear();
@ -62,7 +59,7 @@ fn main() { @@ -62,7 +59,7 @@ fn main() {
}
if keys.intersects(KeyPad::KEY_START) {
println!("See ya!");
break
break;
}
}

4
ctru-rs/examples/hello-both-screens.rs

@ -1,7 +1,5 @@ @@ -1,7 +1,5 @@
extern crate ctru;
use ctru::gfx::{Gfx, Screen};
use ctru::console::Console;
use ctru::gfx::{Gfx, Screen};
use ctru::services::apt::Apt;
use ctru::services::hid::{Hid, KeyPad};

5
ctru-rs/examples/hello-world.rs

@ -1,7 +1,5 @@ @@ -1,7 +1,5 @@
extern crate ctru;
use ctru::gfx::Gfx;
use ctru::console::Console;
use ctru::gfx::Gfx;
use ctru::services::apt::Apt;
use ctru::services::hid::{Hid, KeyPad};
@ -36,7 +34,6 @@ fn main() { @@ -36,7 +34,6 @@ fn main() {
// Main application loop.
while apt.main_loop() {
// Flushes and swaps the framebuffers when double-buffering
// is enabled
gfx.flush_buffers();

6
ctru-rs/examples/software-keyboard.rs

@ -1,10 +1,8 @@ @@ -1,10 +1,8 @@
extern crate ctru;
use ctru::gfx::Gfx;
use ctru::applets::swkbd::{Button, Swkbd};
use ctru::console::Console;
use ctru::gfx::Gfx;
use ctru::services::apt::Apt;
use ctru::services::hid::{Hid, KeyPad};
use ctru::applets::swkbd::{Swkbd, Button};
fn main() {
ctru::init();

1
ctru-rs/src/applets/swkbd.rs

@ -1,3 +1,4 @@ @@ -1,3 +1,4 @@
use bitflags::bitflags;
use ctru_sys::{
self, swkbdInit, swkbdInputText, swkbdSetButton, swkbdSetFeatures, swkbdSetHintText, SwkbdState,
};

6
ctru-rs/src/lib.rs

@ -1,12 +1,6 @@ @@ -1,12 +1,6 @@
#![crate_type = "rlib"]
#![crate_name = "ctru"]
#[macro_use]
extern crate bitflags;
extern crate ctru_sys;
extern crate libc;
extern crate widestring;
/// Call this somewhere to force Rust to link some required crates
/// This is also a setup for some crate integration only available at runtime
///

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

@ -3,18 +3,17 @@ @@ -3,18 +3,17 @@
//! This module contains basic methods to manipulate the contents of the 3DS's filesystem.
//! Only the SD card is currently supported.
use bitflags::bitflags;
use std::ffi::OsString;
use std::io::Error as IoError;
use std::io::ErrorKind as IoErrorKind;
use std::io::Result as IoResult;
use std::io::{Read, Seek, SeekFrom, Write};
use std::ffi::OsString;
use std::mem;
use std::path::{Path, PathBuf};
use std::ptr;
use std::slice;
use std::sync::Arc;
use widestring::{WideCStr, WideCString};
bitflags! {

2
ctru-rs/src/services/hid.rs

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
//! and circle pad information. It also provides information from the sound volume slider,
//! the accelerometer, and the gyroscope.
bitflags! {
bitflags::bitflags! {
/// A set of flags corresponding to the button and directional pad
/// inputs on the 3DS
#[derive(Default)]

2
ctru-sys/src/lib.rs

@ -3,6 +3,4 @@ @@ -3,6 +3,4 @@
#![allow(non_snake_case)]
#![no_std]
extern crate libc;
include!("bindings.rs");

Loading…
Cancel
Save