Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upBorrowed Cow<'_, [u8]> fails if raw bytes not valid utf8 #231
Comments
|
This is super weird. I can't find any code in bincode or serde that would do this. CC @dtolnay |
|
Could be https://github.com/serde-rs/serde/blob/master/serde/src/private/de.rs#L191? I'll try changing that and see if it fixes anything. |
|
Yes I had just found the same thing. That does fix it. Want to send a PR? |
|
Sure, will do. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I thought I was going crazy for a while, so I might still be, but this seems to be a bug in bincode or serde?
This code:
fails with:
I'm not serializing or deserializing any strings, so I am assuming this is a bug. If it's not, could there be another way to fix this?
It does work correctly (accepting invalid UTF8 bytes) if I use either
Vec<u8>or&'a [u8].Thanks!