-
Notifications
You must be signed in to change notification settings - Fork 431
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
Rng renames: gen_ → random_ #1505
base: master
Are you sure you want to change the base?
Conversation
|
||
/// Alias for [`Rng::random_range`]. | ||
#[inline] | ||
#[deprecated(since = "0.9.0", note = "Renamed to `random_range`")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's better to do a deprecating backport and release in the v0.8 branch and remove these methods completely in v0.9?
/// ``` | ||
/// | ||
/// [`Bernoulli`]: distr::Bernoulli | ||
#[inline] | ||
#[track_caller] | ||
fn gen_ratio(&mut self, numerator: u32, denominator: u32) -> bool { | ||
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this name could be misleading. It sounds as if it generates a "random ratio". But I don't have a better proposal than much longer random_bool_with_ratio
or the generic argument proposal, so I guess it's fine.
I don't really like the new name. I would prefer something like I agree that |
CHANGELOG.md
entrySummary
This appears to be the conclusion of #1503:
Opinion
My personal feeling is that this is a poor choice. We recently renamed
rand::distributions
torand::distr
because the latter was easier to type and consistent withrand_distr
(see #1381). This achieves some level of consistency (excepting thatrandom_bool
describes its output while otherrandom*
methods describe their input), but is not concise.