Browse Source

Fmt

pull/134/head
Andrea Ciliberti 1 year ago
parent
commit
9662b876bb
  1. 2
      ctru-rs/src/applets/mod.rs
  2. 2
      ctru-rs/src/applets/swkbd.rs
  3. 10
      ctru-rs/src/console.rs
  4. 2
      ctru-rs/src/prelude.rs
  5. 8
      ctru-rs/src/services/ndsp/mod.rs
  6. 4
      ctru-rs/src/services/romfs.rs
  7. 5
      ctru-sys/build.rs

2
ctru-rs/src/applets/mod.rs

@ -1,5 +1,5 @@
//! System Applets. //! System Applets.
//! //!
//! Applets are small integrated programs that the OS makes available to the developer to streamline commonly needed functionality. //! Applets are small integrated programs that the OS makes available to the developer to streamline commonly needed functionality.
//! Thanks to these integrations the developer can avoid wasting time re-implementing common features and instead use a more reliable base for their application. //! Thanks to these integrations the developer can avoid wasting time re-implementing common features and instead use a more reliable base for their application.

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

@ -1,5 +1,5 @@
//! Software Keyboard applet. //! Software Keyboard applet.
//! //!
//! This applet opens a virtual keyboard on the console's bottom screen which lets the player/user write UTF-16 valid text. //! This applet opens a virtual keyboard on the console's bottom screen which lets the player/user write UTF-16 valid text.
use bitflags::bitflags; use bitflags::bitflags;

10
ctru-rs/src/console.rs

@ -10,16 +10,16 @@ use crate::services::gfx::Screen;
static mut EMPTY_CONSOLE: PrintConsole = unsafe { const_zero::const_zero!(PrintConsole) }; static mut EMPTY_CONSOLE: PrintConsole = unsafe { const_zero::const_zero!(PrintConsole) };
/// Virtual printable console. /// Virtual printable console.
/// ///
/// [`Console`] lets the application redirect `stdout` to a simple text displayer on the 3DS screen. /// [`Console`] lets the application redirect `stdout` to a simple text displayer on the 3DS screen.
/// This means that any text written to `stdout` (e.g. using [`println!`] or [`dbg!`]) will become visible in the area taken by the console. /// This means that any text written to `stdout` (e.g. using [`println!`] or [`dbg!`]) will become visible in the area taken by the console.
/// ///
/// # Notes /// # Notes
/// ///
/// The console will take full possession of the screen handed to it as long as it stays alive. It also supports ANSI codes. /// The console will take full possession of the screen handed to it as long as it stays alive. It also supports ANSI codes.
/// ///
/// # Alternatives /// # Alternatives
/// ///
/// If you'd like to see live `stdout` output while running the application but can't/don't want to show the text on the 3DS itself, /// If you'd like to see live `stdout` output while running the application but can't/don't want to show the text on the 3DS itself,
/// you can try using [`Soc::redirect_to_3dslink`](crate::services::soc::Soc::redirect_to_3dslink) while activating the `--server` flag for `3dslink` (also supported by `cargo-3ds`). /// you can try using [`Soc::redirect_to_3dslink`](crate::services::soc::Soc::redirect_to_3dslink) while activating the `--server` flag for `3dslink` (also supported by `cargo-3ds`).
/// More info in the `cargo-3ds` docs. /// More info in the `cargo-3ds` docs.

2
ctru-rs/src/prelude.rs

@ -1,5 +1,5 @@
//! `use ctru::prelude::*;` to import common services, members and functions. //! `use ctru::prelude::*;` to import common services, members and functions.
//! //!
//! Particularly useful when writing very small applications. //! Particularly useful when writing very small applications.
pub use crate::console::Console; pub use crate::console::Console;

8
ctru-rs/src/services/ndsp/mod.rs

@ -74,13 +74,13 @@ pub enum NdspError {
} }
/// NDSP Channel representation. /// NDSP Channel representation.
/// ///
/// There are 24 individual channels in total and each can play a different audio [`Wave`] simultaneuosly. /// There are 24 individual channels in total and each can play a different audio [`Wave`] simultaneuosly.
/// ///
/// # Default /// # Default
/// ///
/// NDSP initialises all channels with default values on creation, but the developer is supposed to change these values to correctly work with the service. /// NDSP initialises all channels with default values on creation, but the developer is supposed to change these values to correctly work with the service.
/// ///
/// In particular: /// In particular:
/// - Default audio format is set to [`AudioFormat::PCM16Mono`]. /// - Default audio format is set to [`AudioFormat::PCM16Mono`].
/// - Default sample rate is set to 1 Hz. /// - Default sample rate is set to 1 Hz.

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

@ -19,10 +19,10 @@ use std::sync::Mutex;
use crate::services::ServiceReference; use crate::services::ServiceReference;
/// Handle to the RomFS service. /// Handle to the RomFS service.
/// ///
/// This service lets the application access a virtual mounted device created using a folder included within the application bundle. /// This service lets the application access a virtual mounted device created using a folder included within the application bundle.
/// `ctru-rs` will include as RomFS the folder specified in the `Cargo.toml` manifest (or use `./romfs` by default). Look at the [`romfs`](self) module for more information. /// `ctru-rs` will include as RomFS the folder specified in the `Cargo.toml` manifest (or use `./romfs` by default). Look at the [`romfs`](self) module for more information.
/// ///
/// After mounting the RomFS file system, the included files and folders will be accessible exactly like any other file, just by using the drive prefix `romfs:/`. /// After mounting the RomFS file system, the included files and folders will be accessible exactly like any other file, just by using the drive prefix `romfs:/`.
pub struct RomFS { pub struct RomFS {
_service_handler: ServiceReference, _service_handler: ServiceReference,

5
ctru-sys/build.rs

@ -77,8 +77,9 @@ fn check_libctru_version() -> Result<(String, String, String), Box<dyn Error>> {
.output()?; .output()?;
for line in String::from_utf8_lossy(&stdout).split('\n') { for line in String::from_utf8_lossy(&stdout).split('\n') {
let Some((_pkg, file)) = line.split_once(char::is_whitespace) let Some((_pkg, file)) = line.split_once(char::is_whitespace) else {
else { continue }; continue;
};
println!("cargo:rerun-if-changed={file}"); println!("cargo:rerun-if-changed={file}");
} }

Loading…
Cancel
Save