From b618d972b20459437220674bb7a7e024747f3a8d Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 11 Dec 2021 21:17:45 -0800 Subject: [PATCH] Adjust documentation --- Cargo.toml | 2 +- README.md | 23 ++++++++++------------- src/lib.rs | 23 ++++++++--------------- 3 files changed, 19 insertions(+), 29 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5c48d0a..87ae67c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.4.8" # remember to update html_root_url authors = ["David Tolnay "] rust-version = "1.36" license = "MIT OR Apache-2.0" -description = "Fast functions for printing integer primitives to an io::Write" +description = "Fast integer primitive to string conversion" repository = "https://github.com/dtolnay/itoa" documentation = "https://docs.rs/itoa" categories = ["value-formatting"] diff --git a/README.md b/README.md index 77683d2..fa3d93e 100644 --- a/README.md +++ b/README.md @@ -6,19 +6,16 @@ itoa [docs.rs](https://docs.rs/itoa) [build status](https://github.com/dtolnay/itoa/actions?query=branch%3Amaster) -This crate provides fast functions for printing integer primitives to an -[`io::Write`] or a [`fmt::Write`]. The implementation comes straight from -[libcore] but avoids the performance penalty of going through -[`fmt::Formatter`]. +This crate provides a fast conversion of integer primitives to decimal strings. +The implementation comes straight from [libcore] but avoids the performance +penalty of going through [`core::fmt::Formatter`]. See also [`dtoa`] for printing floating point primitives. *Version requirement: rustc 1.36+* -[`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html -[`fmt::Write`]: https://doc.rust-lang.org/core/fmt/trait.Write.html [libcore]: https://github.com/rust-lang/rust/blob/b8214dc6c6fc20d0a660fb5700dca9ebf51ebe89/src/libcore/fmt/num.rs#L201-L254 -[`fmt::Formatter`]: https://doc.rust-lang.org/std/fmt/struct.Formatter.html +[`core::fmt::Formatter`]: https://doc.rust-lang.org/std/fmt/struct.Formatter.html [`dtoa`]: https://github.com/dtolnay/dtoa ```toml @@ -28,12 +25,6 @@ itoa = "0.4"
-## Performance (lower is better) - -![performance](https://raw.githubusercontent.com/dtolnay/itoa/master/performance.png) - -
- ## Example ```rust @@ -46,6 +37,12 @@ fn main() {
+## Performance (lower is better) + +![performance](https://raw.githubusercontent.com/dtolnay/itoa/master/performance.png) + +
+ #### License diff --git a/src/lib.rs b/src/lib.rs index fe87354..0cb7b67 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,27 +6,16 @@ //! //!
//! -//! This crate provides fast functions for printing integer primitives to an -//! [`io::Write`] or a [`fmt::Write`]. The implementation comes straight from -//! [libcore] but avoids the performance penalty of going through -//! [`fmt::Formatter`]. +//! This crate provides a fast conversion of integer primitives to decimal +//! strings. The implementation comes straight from [libcore] but avoids the +//! performance penalty of going through [`core::fmt::Formatter`]. //! //! See also [`dtoa`] for printing floating point primitives. //! -//! [`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html -//! [`fmt::Write`]: https://doc.rust-lang.org/core/fmt/trait.Write.html //! [libcore]: https://github.com/rust-lang/rust/blob/b8214dc6c6fc20d0a660fb5700dca9ebf51ebe89/src/libcore/fmt/num.rs#L201-L254 -//! [`fmt::Formatter`]: https://doc.rust-lang.org/std/fmt/struct.Formatter.html +//! [`core::fmt::Formatter`]: https://doc.rust-lang.org/std/fmt/struct.Formatter.html //! [`dtoa`]: https://github.com/dtolnay/dtoa //! -//!
-//! -//! # Performance (lower is better) -//! -//! ![performance](https://raw.githubusercontent.com/dtolnay/itoa/master/performance.png) -//! -//!
-//! //! # Example //! //! ``` @@ -36,6 +25,10 @@ //! assert_eq!(printed, "128"); //! } //! ``` +//! +//! # Performance (lower is better) +//! +//! ![performance](https://raw.githubusercontent.com/dtolnay/itoa/master/performance.png) #![doc(html_root_url = "https://docs.rs/itoa/0.4.8")] #![no_std]