-
Notifications
You must be signed in to change notification settings - Fork 432
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 rand::seq::gen_index public ? #1373
Comments
What does |
We could, though it's not much code to copy+paste. Specifically for enum variants, you are surely never going to be sampling larger than |
Yes only small usize values. |
So why not copy but simplify to only the 32-bit path? Actually, can't you determine the number of variants and select an appropriate method at compile time? |
I copy/pasted the function, thanks! |
Hello,
in order to choose a random variant in an enum (with help of Peternator7/strum#297), I would like to use rand::seq::gen_index as index, as it would suppress the need for Option, Iterator, etc.
But it is not marked public.
Would it be possible ? I could just copy/paste it but maybe others need it.
The text was updated successfully, but these errors were encountered: