Reword Buffer documentation
This commit is contained in:
parent
bfd3ee6f24
commit
4f958fd42f
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue