-
Notifications
You must be signed in to change notification settings - Fork 27
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
Update to rand master #53
Conversation
#[inline] | ||
fn from_rng<R: RngCore>(rng: R) -> Result<Self, Error> { | ||
BlockRng::<Hc128Core>::from_rng(rng).map(Hc128Rng) | ||
fn from_rng(rng: impl RngCore) -> Self { | ||
Hc128Rng(BlockRng::<Hc128Core>::from_rng(rng)) | ||
} | ||
|
||
#[inline] | ||
fn try_from_rng<R: TryRngCore>(rng: R) -> Result<Self, R::Error> { | ||
BlockRng::<Hc128Core>::try_from_rng(rng).map(Hc128Rng) | ||
} |
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.
In many cases, I think we need to implement both of these. Annoying, but not terrible.
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.
As I suggested some time ago, in the new release cycle it may be worth to drop the block stuff completely. I will try to do a draft PR later.
impl<F> rand_core::TryRngCore for JitterRng<F> | ||
where | ||
F: Fn() -> u64 + Send + Sync, | ||
{ |
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.
We can't use impl_try_rng_from_rng_core
here. Ideally it would support types with generics, but probably not worth bothering.
The test fails with CoarseTimer on one test target, showing that test_timer does something useful.
Temporarily, we patch this repo to use rand from git. Not ideal, but: