commit | b3aca06ece3a863e522ddcad6b9588b6eb9eb527 | [log] [tgz] |
---|---|---|
author | Matthew Maurer <mmaurer@google.com> | Tue Mar 07 17:24:05 2023 -0800 |
committer | Matthew Maurer <mmaurer@google.com> | Tue Mar 07 17:24:05 2023 -0800 |
tree | 7063856b00fcda978586fe349806ad14c4e22c9c | |
parent | 87401d840312fa37bc752cf1799c487470e337f3 [diff] |
Make itoa available to product and vendor Bug: 270690570 Test: mma in external/rust/crates Change-Id: I81ff51aade532508fb274d4107fe3a08629c4dde
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 ryu
for printing floating point primitives.
Version requirement: rustc 1.36+
[dependencies] itoa = "1.0"
fn main() { let mut buffer = itoa::Buffer::new(); let printed = buffer.format(128u64); assert_eq!(printed, "128"); }