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

Consider pruning gen_weighted_bool #47

Closed
eternaleye opened this issue Apr 16, 2015 · 2 comments · Fixed by #773
Closed

Consider pruning gen_weighted_bool #47

eternaleye opened this issue Apr 16, 2015 · 2 comments · Fixed by #773
Labels
B-API Breakage: API

Comments

@eternaleye
Copy link

It's trivial to open-code; it may not be worth the benefit to have it as a method.

If it is kept, perhaps change the check from n <= 1 to n == 0 to be clearer as to the intent, as only n == 0 would cause misbehavior in gen_range().

@dhardy
Copy link
Member

dhardy commented Mar 4, 2018

A search on github shows about 400 matches for gen_weighted_bool, though probably quite a lot of those are duplicates. Quite a few use n = 2; in this case I'm not sure why they aren't using gen::<bool>(). Some of the rest use 3, some constants like 10, 100, 1000 or even 10000, and some use variables.

This feels quite niche; I'm not really sure whether to keep it and improve the doc or remove.

@dhardy
Copy link
Member

dhardy commented Mar 19, 2018

#308 does exactly this

@dhardy dhardy closed this as completed Mar 19, 2018
vks pushed a commit to vks/rand that referenced this issue Apr 9, 2018
of `use bar as foo`.

Change all uses of `use foo = bar` to `use bar as foo`.

Implements RFC rust-random#47.

Closes #16461.

[breaking-change]
vks added a commit to vks/rand that referenced this issue Apr 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-API Breakage: API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants