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 as 1. If I then deserialize it using deserialize_any, it will become 1u8 because it falls into the u8 range.
If instead 1u32 got serialized as 1u32, this would not be an issue. It would also allow ron to skip the any_num range checks.
I propose a new PrettyConfig::explicit_primitive_types option that enables this behavior.
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 become1u8because it falls into the u8 range.If instead
1u32got serialized as1u32, this would not be an issue. It would also allow ron to skip theany_numrange checks.I propose a new
PrettyConfig::explicit_primitive_typesoption that enables this behavior.