Skip to content

Lossless primitive types #241

@cart

Description

@cart

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA new feature for the syntax or library.good first issuePerfect for new contributorshelp wanted

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions