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

Update all dependencies #522

Merged
merged 4 commits into from
May 30, 2023
Merged

Conversation

fosskers
Copy link
Contributor

This PR updates all dependencies to avoid multiple versions of transitive dependencies in downstream users of this crate.

Comment on lines +418 to +435
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)
}
}
Copy link
Contributor Author

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 Vecs are generated.

The clamping is probably not as elegant as it could be, but it solves the problem.

@fosskers
Copy link
Contributor Author

Hi, any thoughts?

@theotherphil theotherphil merged commit 2bb3347 into image-rs:master May 30, 2023
@theotherphil
Copy link
Contributor

Thanks!

@fosskers fosskers deleted the colin/modernize branch June 28, 2023 07:00
@fosskers
Copy link
Contributor Author

Thanks for the merge! Would it be possible to make a release that includes these bumps?

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

Successfully merging this pull request may close these issues.

None yet

2 participants