Skip to content

Commit 6df1731

Browse files
author
=
committed
Improve documentation a little more
1 parent d4ac870 commit 6df1731

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

ctru-rs/src/applets/error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ impl PopUp {
6565
/// # let _runner = test_runner::GdbRunner::default();
6666
/// # fn main() {
6767
/// #
68+
/// use ctru::applets::error::{PopUp, WordWrap};
6869
/// use std::fmt::Write;
6970
///
7071
/// let mut popup = PopUp::new(WordWrap::Enabled);

ctru-rs/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ pub fn set_panic_hook(call_old_hook: bool) {
8989
///
9090
/// This type is mainly useful for interop with `libctru` APIs that expect UTF-16 text as input. The writer implements the
9191
/// [`std::fmt::Write`](https://doc.rust-lang.org/std/fmt/trait.Write.html) trait and ensures that the text is written in-bounds and properly nul-terminated.
92+
///
93+
/// # Notes
94+
///
95+
/// Subsequent writes to the same `Utf16Writer` will append to the buffer instead of overwriting the existing contents. If you want to start over from the
96+
/// beginning of the buffer, simply create a new `Utf16Writer`.
97+
///
98+
/// If a write causes the buffer to reach the end of its capacity, `std::fmt::Error` will be returned, but all string data up until the end of the capacity will
99+
/// still be written.
92100
pub struct Utf16Writer<'a> {
93101
buf: &'a mut [u16],
94102
index: usize,

0 commit comments

Comments
 (0)