-
-
Couldn't load subscription status.
- Fork 477
Move fn read_adapter out of trait TryRngCore #1669
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
Conversation
|
This is currently only available in |
|
I think we could move the method to the |
rand_core/Cargo.toml
Outdated
|
|
||
| # Enable better Debug impl for RngReader | ||
| # This is an unstable feature requiring nightly rustc! | ||
| specialization = [] |
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 would prefer to just remove the method, the wrapper, and the std feature.
|
Methods fix the receiver type (i.e. |
|
My main point is that we probably should move |
5ff6ed9 to
8c5840f
Compare
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 would also remove the std feature since it's only used to enable getrandom/std and we plan to remove getrandom either way.
Also, do not forget to update changelogs.
It's still used by |
CHANGELOG.mdentrySummary
Move fn read_adapter out of trait TryRngCore, renaming the adapter to
RngReader.Remove
&mutindirection insideRngReader. We can still use&mut RwhereR: RngCorebut not&mut OsRngsince the latter does not implementTryRngCore. (Taking non-RngCoretry-RNGs by value likeRngReader(OsRng)does work.)Also add unstable feature
specialization. Since this is documented as unstable and only usable on nightly rustc we don't need to worry about mis-use too much, except maybe via--all-features.Alternatives
We could drop theRemoved.specializationfeature.We could keep the
&mutindirection; I don't think there's a strong incentive though.We could putMoved toRngReaderinrandor another crate.rand.