-
Notifications
You must be signed in to change notification settings - Fork 123
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
Auto Some-wrapping of Option<T> config values #231
Comments
I believe this is what the newtype extension does - #72 |
@kvark I don't mean newtype wrapping, I meant if my struct has a field It could be said that's not a good behavior if there is ambiguity in cases like So it seems to be non-ambiguous, and it would really improve the usability of handwriting RON files to have auto-Some wrapping :) |
Ah sorry, you are totally right, discard my previous comment 😅 |
@Boscop If you are willing to use third-party crates you could try |
@jonasbb Thanks. (Btw, this issue was about deserializing |
@Boscop The listed combination of attributes works for serialization and deserialization. This allows you to round trip the data. It also allows you to omit the
Yes, exactly. This then allows you to also serialize these documents. |
That's a great advantage, the extension attribute line confuses people who come from JSON. |
Issue has had no activity in the last 180 days and is going to be closed in 7 days if no further activity occurs |
E.g. if the Config struct contains a
foo: Option<i32>
, a value offoo: 42
in the config should be accepted, and converted toSome(42)
automatically, instead of failing to deserialize.The text was updated successfully, but these errors were encountered: