-
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
Lossless primitive types #241
Comments
That sounds quite reasonable to me 👍 |
Fortunately my use case doesn't require it to be fully self describing. This is the only change I want. It's just a small iterative improvement to an already working system. |
Issue has had no activity in the last 180 days and is going to be closed in 7 days if no further activity occurs |
comment |
I think especially with #479, I'm now convinced that this is a good idea to ensure that values can roundtrip. I'll see if I can work on this tomorrow. As I'm on it, I should also check the integer and float parsing rules to ensure that both accept
|
I'm using ron to deserialize types that are not known at compile time. It would be really nice to have the option to fully encode primitive types in ron so that type information isn't lost.
Ex: if i serialize
1u32
, it will be written as1
. If I then deserialize it using deserialize_any, it will become1u8
because it falls into the u8 range.If instead
1u32
got serialized as1u32
, this would not be an issue. It would also allow ron to skip theany_num
range checks.I propose a new
PrettyConfig::explicit_primitive_types
option that enables this behavior.The text was updated successfully, but these errors were encountered: