You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rename the module rand::distributions to rand::distr.
Add an alias re-exporting the module through rand::distributions to avoid unnecessary breakage.
pubmod distr;#[doc(no_inline)]pubuse distr as distributions;
Motivation
distr is easier to type than distributions
Consistency with rand_distr
Consistency with the Rust standard library which abbreviates most long module names (cmp, env, alloc, mem, but exceptionally collections)
Note: we do not abbreviate to dist partly because rand_distr already established a convention but mostly "distr" is relatively unambiguous whereas "dist" has other likely meanings.
Making distr the official module name encourages usage; adding distributions as an alias limits breakage for the many existing users.
Alternative: no alias
The plan above is to never remove the alias: there is no support for deprecating aliases. This may cause users some confusion when reading code, especially if we choose to hide the alias in docs.
As an alternative, we could rename without an alias. Most users should only need to fix a few imports or can easily search-and-replace rand::distributions, besides which the next release will have some breakage (notably, distribution constructors now return a Result).
The text was updated successfully, but these errors were encountered:
Summary
Rename the module
rand::distributions
torand::distr
.Add an alias re-exporting the module through
rand::distributions
to avoid unnecessary breakage.Motivation
distr
is easier to type thandistributions
rand_distr
cmp
,env
,alloc
,mem
, but exceptionallycollections
)Note: we do not abbreviate to
dist
partly becauserand_distr
already established a convention but mostly "distr" is relatively unambiguous whereas "dist" has other likely meanings.Making
distr
the official module name encourages usage; addingdistributions
as an alias limits breakage for the many existing users.Alternative: no alias
The plan above is to never remove the alias: there is no support for deprecating aliases. This may cause users some confusion when reading code, especially if we choose to hide the alias in docs.
As an alternative, we could rename without an alias. Most users should only need to fix a few imports or can easily search-and-replace
rand::distributions
, besides which the next release will have some breakage (notably, distribution constructors now return aResult
).The text was updated successfully, but these errors were encountered: