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

Expose Score enum #81

Merged
merged 7 commits into from
May 25, 2024
Merged

Expose Score enum #81

merged 7 commits into from
May 25, 2024

Conversation

tmpfs
Copy link
Contributor

@tmpfs tmpfs commented May 24, 2024

I noticed upgrading from 2.2.2 to 3.0 that the Score (which used to be u8) is private.

This breaks my usage of this library so I just exported Score to be public.

I can't see any reason to keep Score private as it's exposed in Entropy, I guess this is an oversight with the refactor?

@tmpfs
Copy link
Contributor Author

tmpfs commented May 24, 2024

Also out of curiosity why are you converting to i8 for Score when all the enum variants are unsigned and you used u8 before?

@tmpfs
Copy link
Contributor Author

tmpfs commented May 24, 2024

I should have put it in another PR but I also derived Deserialize for Score and I think it would be worth doing for all types when feature is ser - what do you think? Can split into a separate PR if you prefer.

@shssoichiro
Copy link
Owner

Thanks, just one question, this looks good. I'm surprised the compiler didn't complain about Score being private, it shouldn't be possible if it's exposed in Entropy which is public.

@tmpfs
Copy link
Contributor Author

tmpfs commented May 25, 2024

Thanks, just one question, this looks good. I'm surprised the compiler didn't complain about Score being private, it shouldn't be possible if it's exposed in Entropy which is public.

Indeed this is a little surprising, I am not sure why this happened; maybe a nuance of the compiler heuristics I don't fully understand 🤷

Is this ok now with the serde fix?

@shssoichiro
Copy link
Owner

Yes, thank you! I'll put out a 3.0.1 with this asap.

@shssoichiro shssoichiro merged commit a9cf880 into shssoichiro:master May 25, 2024
5 checks passed
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