I use this crate a lot, especially in no_std or performance-sensitive environments. and I use encode_to_slice quite a lot, and usually, I need then to convert the slice into an str to pass to a serializer/formatter.
I think it makes sense that encode_to_slice will return a &mut str because it just checked all the invariants and can verify that in debug mode.
Sadly this breaks the API in the rare case where the returned () was used, so bumped to 0.5.
The errors are completely unrelated to this PR, I can still fix them if you prefer (although I'm not sure if changing the lint name will break older rustc versions)
I use this crate a lot, especially in
no_std
or performance-sensitive environments. and I useencode_to_slice
quite a lot, and usually, I need then to convert the slice into anstr
to pass to a serializer/formatter. I think it makes sense thatencode_to_slice
will return a&mut str
because it just checked all the invariants and can verify that in debug mode.Sadly this breaks the API in the rare case where the returned
()
was used, so bumped to 0.5.