Eliminate itoa::write and itoa::fmt from rustdoc

This commit is contained in:
David Tolnay 2021-12-11 20:48:02 -08:00
parent f42787cdc2
commit 2581c8cee7
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
1 changed files with 7 additions and 26 deletions

View File

@ -27,32 +27,13 @@
//! //!
//! <br> //! <br>
//! //!
//! # Examples //! # Example
//! //!
//! ```edition2018 //! ```
//! use std::{fmt, io}; //! fn main() {
//! //! let mut buffer = itoa::Buffer::new();
//! fn demo_itoa_write() -> io::Result<()> { //! let printed = buffer.format(128u64);
//! // Write to a vector or other io::Write. //! assert_eq!(printed, "128");
//! let mut buf = Vec::new();
//! itoa::write(&mut buf, 128u64)?;
//! println!("{:?}", buf);
//!
//! // Write to a stack buffer.
//! let mut bytes = [0u8; 20];
//! let n = itoa::write(&mut bytes[..], 128u64)?;
//! println!("{:?}", &bytes[..n]);
//!
//! Ok(())
//! }
//!
//! fn demo_itoa_fmt() -> fmt::Result {
//! // Write to a string.
//! let mut s = String::new();
//! itoa::fmt(&mut s, 128u64)?;
//! println!("{}", s);
//!
//! Ok(())
//! } //! }
//! ``` //! ```
@ -147,7 +128,7 @@ mod private {
pub trait Sealed {} pub trait Sealed {}
} }
/// An integer that can be formatted by `itoa::write` and `itoa::fmt`. /// An integer that can be written into an [`itoa::Buffer`][Buffer].
/// ///
/// This trait is sealed and cannot be implemented for types outside of itoa. /// This trait is sealed and cannot be implemented for types outside of itoa.
pub trait Integer: private::Sealed { pub trait Integer: private::Sealed {