Skip to content

Support i128 and u128 #846

Closed
Closed
@tustvold

Description

Currently by default this crate supports numbers up to 64-bits. For larger types it is necessary to enable the arbitrary_precision feature, which treats numbers as strings. Whilst this works, it can have unintended consequences as it changes the semantics of how integers are fed into the serde machinery - see #845.

I wonder if serde_json might add support for 128-bit types within Number and the associated serializer implementations on platforms that support such types - e.g. by using serde_if_integer128. This would allow crates to use 128-bit types without needing to opt-in to arbitrary_precision.

I would be happy to contribute a PR if this is an acceptable course of action?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions