Browse Source

Merge pull request #70 from Meziu/feature/prelude

Prelude module addition
pull/71/head
Meziu 2 years ago committed by GitHub
parent
commit
691c12b93b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      ctru-rs/examples/buttons.rs
  2. 6
      ctru-rs/examples/file-explorer.rs
  3. 6
      ctru-rs/examples/futures-basic.rs
  4. 6
      ctru-rs/examples/futures-tokio.rs
  5. 5
      ctru-rs/examples/gfx-wide-mode.rs
  6. 5
      ctru-rs/examples/graphics-bitmap.rs
  7. 5
      ctru-rs/examples/hashmaps.rs
  8. 5
      ctru-rs/examples/hello-both-screens.rs
  9. 5
      ctru-rs/examples/hello-world.rs
  10. 6
      ctru-rs/examples/network-sockets.rs
  11. 5
      ctru-rs/examples/output-3dslink.rs
  12. 5
      ctru-rs/examples/romfs.rs
  13. 5
      ctru-rs/examples/software-keyboard.rs
  14. 5
      ctru-rs/examples/system-configuration.rs
  15. 6
      ctru-rs/examples/thread-basic.rs
  16. 6
      ctru-rs/examples/thread-info.rs
  17. 6
      ctru-rs/examples/thread-locals.rs
  18. 5
      ctru-rs/examples/time-rtc.rs
  19. 4
      ctru-rs/src/lib.rs
  20. 3
      ctru-rs/src/prelude.rs

5
ctru-rs/examples/buttons.rs

@ -1,7 +1,4 @@ @@ -1,7 +1,4 @@
use ctru::console::Console;
use ctru::gfx::Gfx;
use ctru::services::apt::Apt;
use ctru::services::hid::{Hid, KeyPad};
use ctru::prelude::*;
fn main() {
// Setup services

6
ctru-rs/examples/file-explorer.rs

@ -2,10 +2,8 @@ @@ -2,10 +2,8 @@
//! read the SD card.
use ctru::applets::swkbd::{Button, Swkbd};
use ctru::console::Console;
use ctru::services::hid::KeyPad;
use ctru::services::{Apt, Hid};
use ctru::Gfx;
use ctru::prelude::*;
use std::fs::DirEntry;
use std::os::horizon::fs::MetadataExt;
use std::path::{Path, PathBuf};

6
ctru-rs/examples/futures-basic.rs

@ -7,10 +7,8 @@ @@ -7,10 +7,8 @@
#![feature(horizon_thread_ext)]
use ctru::console::Console;
use ctru::services::hid::KeyPad;
use ctru::services::{Apt, Hid};
use ctru::Gfx;
use ctru::prelude::*;
use futures::StreamExt;
use std::os::horizon::thread::BuilderExt;

6
ctru-rs/examples/futures-tokio.rs

@ -1,9 +1,7 @@ @@ -1,9 +1,7 @@
#![feature(horizon_thread_ext)]
use ctru::console::Console;
use ctru::services::hid::KeyPad;
use ctru::services::{Apt, Hid};
use ctru::Gfx;
use ctru::prelude::*;
use std::os::horizon::thread::BuilderExt;
use std::time::Duration;

5
ctru-rs/examples/gfx-wide-mode.rs

@ -1,7 +1,4 @@ @@ -1,7 +1,4 @@
use ctru::console::Console;
use ctru::services::hid::KeyPad;
use ctru::services::{Apt, Hid};
use ctru::Gfx;
use ctru::prelude::*;
fn main() {
ctru::init();

5
ctru-rs/examples/graphics-bitmap.rs

@ -1,8 +1,5 @@ @@ -1,8 +1,5 @@
use ctru::console::Console;
use ctru::gfx::Screen as _;
use ctru::services::hid::KeyPad;
use ctru::services::{Apt, Hid};
use ctru::Gfx;
use ctru::prelude::*;
/// Ferris image taken from <https://rustacean.net> and scaled down to 320x240px.
/// To regenerate the data, you will need to install `imagemagick` and run this

5
ctru-rs/examples/hashmaps.rs

@ -1,7 +1,4 @@ @@ -1,7 +1,4 @@
use ctru::console::Console;
use ctru::gfx::Gfx;
use ctru::services::apt::Apt;
use ctru::services::hid::{Hid, KeyPad};
use ctru::prelude::*;
fn main() {
// Initialize services

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

@ -1,7 +1,4 @@ @@ -1,7 +1,4 @@
use ctru::console::Console;
use ctru::gfx::Gfx;
use ctru::services::apt::Apt;
use ctru::services::hid::{Hid, KeyPad};
use ctru::prelude::*;
fn main() {
// Initialize services

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

@ -1,7 +1,4 @@ @@ -1,7 +1,4 @@
use ctru::console::Console;
use ctru::gfx::Gfx;
use ctru::services::apt::Apt;
use ctru::services::hid::{Hid, KeyPad};
use ctru::prelude::*;
use std::io::BufWriter;

6
ctru-rs/examples/network-sockets.rs

@ -1,8 +1,4 @@ @@ -1,8 +1,4 @@
use ctru::console::Console;
use ctru::gfx::Gfx;
use ctru::services::apt::Apt;
use ctru::services::hid::{Hid, KeyPad};
use ctru::services::soc::Soc;
use ctru::prelude::*;
use std::io::{self, Read, Write};
use std::net::{Shutdown, TcpListener};

5
ctru-rs/examples/output-3dslink.rs

@ -8,10 +8,7 @@ @@ -8,10 +8,7 @@
//! 3dslink --server target/armv6k-nintendo-3ds/debug/examples/output-3dslink.3dsx
//! ```
use ctru::gfx::Gfx;
use ctru::services::apt::Apt;
use ctru::services::hid::{Hid, KeyPad};
use ctru::services::soc::Soc;
use ctru::prelude::*;
fn main() {
ctru::init();

5
ctru-rs/examples/romfs.rs

@ -1,7 +1,4 @@ @@ -1,7 +1,4 @@
use ctru::console::Console;
use ctru::gfx::Gfx;
use ctru::services::apt::Apt;
use ctru::services::hid::{Hid, KeyPad};
use ctru::prelude::*;
fn main() {
ctru::init();

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

@ -1,8 +1,5 @@ @@ -1,8 +1,5 @@
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::prelude::*;
fn main() {
ctru::init();

5
ctru-rs/examples/system-configuration.rs

@ -1,8 +1,5 @@ @@ -1,8 +1,5 @@
use ctru::console::Console;
use ctru::gfx::Gfx;
use ctru::services::apt::Apt;
use ctru::prelude::*;
use ctru::services::cfgu::Cfgu;
use ctru::services::hid::{Hid, KeyPad};
fn main() {
ctru::init();

6
ctru-rs/examples/thread-basic.rs

@ -1,9 +1,7 @@ @@ -1,9 +1,7 @@
#![feature(horizon_thread_ext)]
use ctru::console::Console;
use ctru::gfx::Gfx;
use ctru::services::apt::Apt;
use ctru::services::hid::{Hid, KeyPad};
use ctru::prelude::*;
use std::os::horizon::thread::BuilderExt;
use std::time::Duration;

6
ctru-rs/examples/thread-info.rs

@ -2,10 +2,8 @@ @@ -2,10 +2,8 @@
#![feature(horizon_thread_ext)]
use ctru::console::Console;
use ctru::gfx::Gfx;
use ctru::services::apt::Apt;
use ctru::services::hid::{Hid, KeyPad};
use ctru::prelude::*;
use std::os::horizon::thread::BuilderExt;
fn main() {

6
ctru-rs/examples/thread-locals.rs

@ -1,9 +1,7 @@ @@ -1,9 +1,7 @@
#![feature(horizon_thread_ext)]
use ctru::console::Console;
use ctru::services::hid::KeyPad;
use ctru::services::{Apt, Hid};
use ctru::Gfx;
use ctru::prelude::*;
use std::cell::RefCell;
use std::os::horizon::thread::BuilderExt;

5
ctru-rs/examples/time-rtc.rs

@ -1,7 +1,4 @@ @@ -1,7 +1,4 @@
use ctru::console::Console;
use ctru::gfx::Gfx;
use ctru::services::apt::Apt;
use ctru::services::hid::{Hid, KeyPad};
use ctru::prelude::*;
fn main() {
ctru::init();

4
ctru-rs/src/lib.rs

@ -75,6 +75,7 @@ pub mod applets; @@ -75,6 +75,7 @@ pub mod applets;
pub mod console;
pub mod error;
pub mod gfx;
pub mod prelude;
pub mod services;
pub mod srv;
@ -101,6 +102,3 @@ cfg_if::cfg_if! { @@ -101,6 +102,3 @@ cfg_if::cfg_if! {
mod test_runner;
pub use crate::error::{Error, Result};
pub use crate::gfx::Gfx;
pub use crate::srv::Srv;

3
ctru-rs/src/prelude.rs

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
pub use crate::console::Console;
pub use crate::gfx::Gfx;
pub use crate::services::{hid::KeyPad, soc::Soc, Apt, Hid};
Loading…
Cancel
Save