Skip to content
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

Allow for more than 256 variant enum: encode variant with compact encoding for integer. #305

Open
thiolliere opened this issue Dec 1, 2021 · 0 comments

Comments

@thiolliere
Copy link
Contributor

As proposed by Gav: we should allow for enum with more than 256 variants, and we can do encoding of the variant index using compact encoding of integers. This way this is not breaking for enum with 0-63 variants.

For the transition we can follow this:

  • having 2 new attributes when deriving encode/decode for enum:
    • compact_variant_index (or a better name)
    • u8_variant_index
  • then we can deprecate the derivation of encode/decode on enum without any attribute
  • then we can force to use one of the 2 attributes
  • then we can make the default being compact_variant_index.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant