[FEATURE] write
APIs should take buffer: &mut [MaybeUninit<u8>]
#92
Labels
write
APIs should take buffer: &mut [MaybeUninit<u8>]
#92
Problem
In the
ToLexical
APIs, they take the destination buffer as type&mut [u8]
. According to Rust's soundness rules, this requires the buffer to be initialized before callingto_lexical
orto_lexical_unchecked
, even though both of those functions only write to the buffer. I'd like to useToLexical
on uninitialized buffers (such asVec::spare_capacity_mut
).Solution
Can we have a variant of the
ToLexical
APIs to take the destination buffer as type&mut [MaybeUninit<u8>]
?The text was updated successfully, but these errors were encountered: