Open dtolnay opened 1 year ago
I can't tell whether this was a stylistic choice or oversight. My preference is for serialize_with_flavor::<T, Cobs<Slice<'a>>>(...)
over serialize_with_flavor::<T, Cobs<Slice<'a>>, &'a mut [u8]>(...)
, but I can see there may be valid preferences in the other direction.
As far as I can tell - this was likely an oversight, probably an artifact implementing flavors and never stepping back and realizing that those (always?) are the same type.
I do think this would be a breaking change as you noted in https://github.com/jamesmunns/postcard/pull/105, but I'm tagging it with the 2.0 label so I don't forget to clean this up on the next major release.
postcard::serialize_with_flavor
is written in an odd way that makes the caller restate the Flavor's Output type explicitly when using turbofish.https://github.com/jamesmunns/postcard/blob/a0ef8a2f90f53f1c30a554624c187a9672d098c9/src/ser/mod.rs#L367-L370