tree: c9119e986f8b0774d4d8e9768308fb5d57bb06f4 [path history] [tgz]
  1. benches/
  2. patches/
  3. src/
  4. tests/
  5. .android-checksum.json
  6. .cargo-checksum.json
  7. Android.bp
  8. Cargo.toml
  9. cargo_embargo.json
  10. LICENSE
  11. LICENSE-APACHE
  12. LICENSE-MIT
  13. METADATA
  14. MODULE_LICENSE_APACHE2
  15. README.md
  16. TEST_MAPPING
crates/itoa/README.md

itoa

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"

Example

fn main() {
    let mut buffer = itoa::Buffer::new();
    let printed = buffer.format(128u64);
    assert_eq!(printed, "128");
}

Performance (lower is better)

performance

License