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

Make variant index explicit, remove discriminant #112

Merged
merged 2 commits into from
Jul 15, 2021

Conversation

ascjones
Copy link
Contributor

Based on feedback from @jacogr.

Explicitly specify enum variant index. Prevents consumers having to duplicate the logic of inferring missing indices by the position in the list of variants.

Also removes discriminant, it was actually populated with the same value as index would be anyway. It's a legacy of when this was aiming to be general purpose Rust static reflection lib. Now we are a SCALE specific lib we should remove this Rust specific concept.

Copy link
Contributor

@Robbepop Robbepop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree we should not put Rust specifics into this format.

@ascjones ascjones merged commit 1608467 into master Jul 15, 2021
@ascjones ascjones deleted the aj-explicit-indices branch July 15, 2021 10:51
This was referenced Jul 27, 2021
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

Successfully merging this pull request may close these issues.

2 participants