Skip to content

Make variant index explicit, remove discriminant#112

Merged
ascjones merged 2 commits intomasterfrom
aj-explicit-indices
Jul 15, 2021
Merged

Make variant index explicit, remove discriminant#112
ascjones merged 2 commits intomasterfrom
aj-explicit-indices

Conversation

@ascjones
Copy link
Copy Markdown
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
Copy Markdown
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