truncating-arraystring 0.1.0

ArrayString wrapper with truncating Write
Documentation
  • Coverage
  • 0%
    0 out of 4 items documented0 out of 3 items with examples
  • Size
  • Source code size: 4.02 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.43 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • yuryshulaev/truncating-arraystring
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • yuryshulaev

truncating-arraystring

ArrayString wrapper with truncating Write.

use std::fmt::Write;
use truncating_arraystring::TruncatingArrayString;

fn main() {
    let mut buf = TruncatingArrayString::<5>::new();
    assert_eq!(write!(buf, "{}", "12"), Ok(()));
    assert_eq!(write!(buf, "{}", "3456789"), Err(std::fmt::Error));
    assert_eq!(&buf.0[..], "12345");
}