-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot deserialize into reference if there are escaped quotation marks in string #742
Comments
The problem here is that due to the escape sequences, If it has to be zero copy deserialization you can check here dtolnay/request-for-implementation#7 |
Ah, interesting, thanks for the reply. Going to leave this here for more context. #318 One thing I'm missing (for my personal understanding) is why? What is it that makes escape sequences hard to manage? Otherwise, Cow is fine for my use case, so I'll use that. Thanks! |
@arlyon the "input" bytes (from the JSON string) contain backslashes (and maybe other characters, like in a sequence like
|
I think given that that this issue is 'solved'. Meant to close it last week but didn't get round to replying. Thanks for the detailed explanation! |
Useful article I stumbled across that may help others in this situation: https://d3lm.medium.com/rust-beware-of-escape-sequences-85ec90e9e243#ee0e-58229fc84d02 |
Thanks @arlyon this was very helpful (for someone starting to use Rust) |
Hi,
Sorry if this issue is known, I'm not sure how to phrase it. I am dealing with json strings, which I am parsing into structs that store string slices into the original string.
Stangely, serde is unable to parse the data if any of these string slices have escaped quotes in them. In the case of the second list element, I receive an error:
Seems that, for whatever reason, it is not able to be borrowed if there is a quotation mark. If I am missing something, please let me know. If there is suspicion that this is a genuine bug I will happily write a minimal reproducing example.
The text was updated successfully, but these errors were encountered: