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

Remove small_rng feature? #1419

Open
dhardy opened this issue Mar 25, 2024 · 1 comment
Open

Remove small_rng feature? #1419

dhardy opened this issue Mar 25, 2024 · 1 comment

Comments

@dhardy
Copy link
Member

dhardy commented Mar 25, 2024

Summary

Remove small_rng feature, thus enabling SmallRng by default and in all builds.

Motivation

Less complexity. Removes a trip-hazard for new users: #1225

If I remember correctly, the motivation for feature-gating adding small_rng was to remove a dependency from builds which don't use it. Later, we decided to add std_rng for the same reason (even though ThreadRng requires it).

We now define the two possible implementations of SmallRng in crate (around 250 LoC). If we changed the impl again, we'd very likely continue to do so (it would be unlikely to use more code).

The additional (small) cost is that SmallRng must be compiled in all builds; linking should remove unused code thus not affecting binary size.

@newpavlov
Copy link
Member

newpavlov commented Mar 25, 2024

The trip-hazard can also be resolved by making small_rng a default feature.

Assuming SmallRng implementation will continue to be part of the rand crate, personally, I am fine with removing the feature.

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

No branches or pull requests

2 participants