-
Notifications
You must be signed in to change notification settings - Fork 271
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
On key-generation example (documentation), "rand" should be "rand-std" instead #389
Conversation
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.
ACK 2732891
Yeah, I think OsRng
requires std
. That's unfortunate.
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.
Thanks for the PR! I actually went to verify this just recently, clearly I should have trusted the code not the docs :) For rand 0.6.5 (which we currently use) the docs for OsRng
do not say that std
features is needed.
Thanks again.
https://docs.rs/rand/0.6.5/rand/rngs/struct.OsRng.html
tACK 2732891
I've found a few "rand" feature requirement in the documentation and have replaced it with "rand-std" (again). |
I don't understand why |
That last commit was not a well-considered commit. I was browsing the documentation and just sort of assumed that it needed to be changed (because it had |
Don't feel bad for getting confused @vinliao, I recently got merged a heap of rustdoc tests that should fail because I used feature-gate EDIT: Seems there is a bug in cargo, the tests in
|
@tcharding should it fail because |
Yes, because we use |
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.
ACK 2732891
Curious that my previous ACK, on this exact commit, no longer counts..
I copy-pasted the key-generation example written on the documentation, but it didn't work. It only worked when I used the feature
rand-std
instead ofrand
.To reproduce, boot up a new Rust project, and add this to main.rs:
Using this dependencies causes error:
secp256k1 = {version="0.21.2", features=["rand", "bitcoin_hashes"]}
. After replacingrand
withrand-std
, it works.