Also some internal changes that I think make stuff more efficient.
A lot of the times I have a fixed length byte buffer to encode, but cause encode_to_slice doesn't give you access to a str you have to do a check or use unsafe to turn it into a str. This makes it like char::encode_utf8(), where you encode into a buffer and then get to actually use the string from it right away. Also encode_fmt is nice for if something's in a Display/Debug implementation, or just if it's not necessary to allocate a whole separate string.
Also some internal changes that I think make stuff more efficient.
A lot of the times I have a fixed length byte buffer to encode, but cause
encode_to_slice
doesn't give you access to a str you have to do a check or use unsafe to turn it into a str. This makes it likechar::encode_utf8()
, where you encode into a buffer and then get to actually use the string from it right away. Alsoencode_fmt
is nice for if something's in a Display/Debug implementation, or just if it's not necessary to allocate a whole separate string.