There is no way to know how many bytes were written in the result, which is a problem when using write with a stack-allocated array. Returning io::Result<usize> would allow this:
let mut buf = [b'\0'; 20];
let len = itoa::write(&mut buf, value)?;
let result = &buf[0..len];
There is no way to know how many bytes were written in the result, which is a problem when using
write
with a stack-allocated array. Returningio::Result<usize>
would allow this: