David Tolnay

Results 700 comments of David Tolnay

Maybe instead of `rename_all` we should have had distinct `rename_fields` and `rename_variants` attributes, so that you can write both to get the desired effect. It may be confusing to add...

I would be willing to consider a pull request that adds a `serde(rename_all_fields = "...")` attribute for enums that applies a rename rule to every field of every variant.

The motivation was to allow for error enhancements like #173 to be made in a non-breaking way. Can you explain in more detail the way that your code needs to...

Yeah I am open to this. I would want to better understand what currently passing (reasonable, correct) tests this would break though, but maybe that would be clearer from seeing...

What is your expectation for what this program should print if it were behaving correctly?

Hi @agausmann, I am still interested in this change but I haven't gotten a chance to take a look yet. It is still definitely on the list (https://triage.rust-lang.org/notifications?user=dtolnay).

This repo includes a relatively cheap way to track the path within a Deserializer: https://github.com/dtolnay/serde-ignored Let's factor the path-tracking part out and use it for errors in serde_json.

I implemented this for serde_yaml in https://github.com/dtolnay/serde-yaml/pull/43. Just need to port it over to JSON.

Here is the library: https://github.com/dtolnay/path-to-error. You can use it to wrap any Deserializer and find out where an error occurs.