arrayvec
arrayvec copied to clipboard
implement std::fmt::Write
I'd like to print! to an ArrayVec or ArrayString on no_std, where std::io::Write does not exist.
fmt::Write is already implemented for ArrayString, so that part's done. How would it work with Arrayvec? There's no precendent (Vec doesn't implement fmt::Write), but if it's explained, maybe it's a good idea?
Oh, I didn't think to check ArrayString, sorry about that! I just saw that heapless had an implementation and that arrayvec didn't. At the core, they simply do self.extend_from_slice(s.as_bytes()) which looks sensible to me.
Yes, that looks good, we can do that for arrayvec