Reword Buffer documentation

This commit is contained in:
David Tolnay 2021-12-12 00:29:34 -08:00
parent bfd3ee6f24
commit 4f958fd42f
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
1 changed files with 4 additions and 3 deletions

View File

@ -48,7 +48,8 @@ mod udiv128;
use core::mem::{self, MaybeUninit}; use core::mem::{self, MaybeUninit};
use core::{ptr, slice, str}; use core::{ptr, slice, str};
/// A safe API for formatting integers to text. /// A correctly sized stack allocation for the formatted integer to be written
/// into.
/// ///
/// # Example /// # Example
/// ///
@ -85,8 +86,8 @@ impl Buffer {
Buffer { bytes } Buffer { bytes }
} }
/// Print an integer into this buffer and return a reference to its string representation /// Print an integer into this buffer and return a reference to its string
/// within the buffer. /// representation within the buffer.
pub fn format<I: Integer>(&mut self, i: I) -> &str { pub fn format<I: Integer>(&mut self, i: I) -> &str {
i.write(self) i.write(self)
} }