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

Simplify From<Tag> for u8 Implementation with Direct Cast #104

Merged
merged 3 commits into from
Mar 15, 2024

Conversation

hollowness-inside
Copy link
Contributor

@hollowness-inside hollowness-inside commented Mar 14, 2024

Refactored the From<Tag> implementation to utilize direct casting instead of a match expression.

@owengage
Copy link
Owner

Seems reasonable! Thanks for the contributions. Can you change the unit test for this to check the explicit values? So basically that a compound is 10 etc.

At the moment I don't think there are any tests that fail if the Tag enum was re-ordered.

@hollowness-inside
Copy link
Contributor Author

Done.
Tests won't fail after re-ordering because discriminants are declared explicitly.
I am happy to help.

@owengage owengage merged commit 47c5fe5 into owengage:master Mar 15, 2024
1 check passed
@owengage
Copy link
Owner

Awesome. Thank you.

@hollowness-inside hollowness-inside deleted the simplify-cast-to-u8 branch March 15, 2024 11:12
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