-
Notifications
You must be signed in to change notification settings - Fork 144
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 all dependencies #522
Conversation
Thank God this didn't explode.
struct BoundedFloat(f64); | ||
|
||
impl Arbitrary for BoundedFloat { | ||
fn arbitrary(g: &mut Gen) -> Self { | ||
let mut f; | ||
|
||
loop { | ||
f = f64::arbitrary(g); | ||
|
||
if f.is_normal() { | ||
f = f.clamp(-1_000_000.0, 1_000_000.0); | ||
break; | ||
} | ||
} | ||
|
||
BoundedFloat(f) | ||
} | ||
} |
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.
With the upgrade to the newest version of quickcheck
, certain degenerate Vec<f64>
were being generated and passed to test cases, either failing outright or causing strange infinite loops. This BoundedFloat
logic ensures that no such degenerate Vec
s are generated.
The clamp
ing is probably not as elegant as it could be, but it solves the problem.
Hi, any thoughts? |
Thanks! |
Thanks for the merge! Would it be possible to make a release that includes these bumps? |
This PR updates all dependencies to avoid multiple versions of transitive dependencies in downstream users of this crate.