-
Notifications
You must be signed in to change notification settings - Fork 108
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
Consider making the fields of Spanned
public
#368
Comments
The only relevant issue I found in the old I generally lean towards types being all I wonder what the rest of the ecosystem does.
|
To add to your list In my own crate I wrote |
I opened #664 to try to make progress by exposing a way to construct I would be happy for us to consider |
As I understand it, #635 adds a mechanism by which authors of a That is not the missing piece in dtolnay/serde-untagged#5. Serde-untagged implements a particularly clever The only way that I see
But:
|
I think
Spanned
should be just a POD with all its fields public or at least thevalue
field should be. Not being public makes matching extra annoying.My use case: I have a toml that allows setting one of two fields only if another is either not set or set to
false
(they are contradictory) so I deserialize both fields and then I match on the tuple of them emitting an error if an invalid combination is present (and convert to a proper enum a valid one is). I'd love to make the error message look as nice as Rust error messages - having "foo specified here" and "bar specified here" messages pointing at the places where they are specified. I need span for this so I'm refactoring the match.The text was updated successfully, but these errors were encountered: