diff --git a/ctru-rs/examples/buttons.rs b/ctru-rs/examples/buttons.rs index e3250c4..60cfba2 100644 --- a/ctru-rs/examples/buttons.rs +++ b/ctru-rs/examples/buttons.rs @@ -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 diff --git a/ctru-rs/examples/file-explorer.rs b/ctru-rs/examples/file-explorer.rs index 181c846..ff6296f 100644 --- a/ctru-rs/examples/file-explorer.rs +++ b/ctru-rs/examples/file-explorer.rs @@ -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}; diff --git a/ctru-rs/examples/futures-basic.rs b/ctru-rs/examples/futures-basic.rs index c66c199..c96c65e 100644 --- a/ctru-rs/examples/futures-basic.rs +++ b/ctru-rs/examples/futures-basic.rs @@ -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; diff --git a/ctru-rs/examples/futures-tokio.rs b/ctru-rs/examples/futures-tokio.rs index c437ed8..2d4ff5a 100644 --- a/ctru-rs/examples/futures-tokio.rs +++ b/ctru-rs/examples/futures-tokio.rs @@ -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; diff --git a/ctru-rs/examples/gfx-wide-mode.rs b/ctru-rs/examples/gfx-wide-mode.rs index f84f5c4..e9026ab 100644 --- a/ctru-rs/examples/gfx-wide-mode.rs +++ b/ctru-rs/examples/gfx-wide-mode.rs @@ -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(); diff --git a/ctru-rs/examples/graphics-bitmap.rs b/ctru-rs/examples/graphics-bitmap.rs index 0d82ecf..a034218 100644 --- a/ctru-rs/examples/graphics-bitmap.rs +++ b/ctru-rs/examples/graphics-bitmap.rs @@ -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 and scaled down to 320x240px. /// To regenerate the data, you will need to install `imagemagick` and run this diff --git a/ctru-rs/examples/hashmaps.rs b/ctru-rs/examples/hashmaps.rs index 0b07939..3218dc5 100644 --- a/ctru-rs/examples/hashmaps.rs +++ b/ctru-rs/examples/hashmaps.rs @@ -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 diff --git a/ctru-rs/examples/hello-both-screens.rs b/ctru-rs/examples/hello-both-screens.rs index 483e5c3..4dcd588 100644 --- a/ctru-rs/examples/hello-both-screens.rs +++ b/ctru-rs/examples/hello-both-screens.rs @@ -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 diff --git a/ctru-rs/examples/hello-world.rs b/ctru-rs/examples/hello-world.rs index 2fcd7fb..5b7e8ee 100644 --- a/ctru-rs/examples/hello-world.rs +++ b/ctru-rs/examples/hello-world.rs @@ -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; diff --git a/ctru-rs/examples/network-sockets.rs b/ctru-rs/examples/network-sockets.rs index 6526d41..a0b64d0 100644 --- a/ctru-rs/examples/network-sockets.rs +++ b/ctru-rs/examples/network-sockets.rs @@ -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}; diff --git a/ctru-rs/examples/output-3dslink.rs b/ctru-rs/examples/output-3dslink.rs index 9c66c9b..9f4a0ea 100644 --- a/ctru-rs/examples/output-3dslink.rs +++ b/ctru-rs/examples/output-3dslink.rs @@ -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(); diff --git a/ctru-rs/examples/romfs.rs b/ctru-rs/examples/romfs.rs index dc1d133..f8549bf 100644 --- a/ctru-rs/examples/romfs.rs +++ b/ctru-rs/examples/romfs.rs @@ -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(); diff --git a/ctru-rs/examples/software-keyboard.rs b/ctru-rs/examples/software-keyboard.rs index 799d65d..b830811 100644 --- a/ctru-rs/examples/software-keyboard.rs +++ b/ctru-rs/examples/software-keyboard.rs @@ -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(); diff --git a/ctru-rs/examples/system-configuration.rs b/ctru-rs/examples/system-configuration.rs index 5b04a0e..ed1eacf 100644 --- a/ctru-rs/examples/system-configuration.rs +++ b/ctru-rs/examples/system-configuration.rs @@ -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(); diff --git a/ctru-rs/examples/thread-basic.rs b/ctru-rs/examples/thread-basic.rs index 0b818f5..069d0a2 100644 --- a/ctru-rs/examples/thread-basic.rs +++ b/ctru-rs/examples/thread-basic.rs @@ -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; diff --git a/ctru-rs/examples/thread-info.rs b/ctru-rs/examples/thread-info.rs index 337c49e..b504b69 100644 --- a/ctru-rs/examples/thread-info.rs +++ b/ctru-rs/examples/thread-info.rs @@ -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() { diff --git a/ctru-rs/examples/thread-locals.rs b/ctru-rs/examples/thread-locals.rs index dcc8b7a..ae46823 100644 --- a/ctru-rs/examples/thread-locals.rs +++ b/ctru-rs/examples/thread-locals.rs @@ -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; diff --git a/ctru-rs/examples/time-rtc.rs b/ctru-rs/examples/time-rtc.rs index b77615a..1554a21 100644 --- a/ctru-rs/examples/time-rtc.rs +++ b/ctru-rs/examples/time-rtc.rs @@ -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(); diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index 5a4aaa9..1f203a6 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -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! { mod test_runner; pub use crate::error::{Error, Result}; - -pub use crate::gfx::Gfx; -pub use crate::srv::Srv; diff --git a/ctru-rs/src/prelude.rs b/ctru-rs/src/prelude.rs new file mode 100644 index 0000000..27196f9 --- /dev/null +++ b/ctru-rs/src/prelude.rs @@ -0,0 +1,3 @@ +pub use crate::console::Console; +pub use crate::gfx::Gfx; +pub use crate::services::{hid::KeyPad, soc::Soc, Apt, Hid};