assert-rs / predicates-rs

Boolean-valued predicate functions in Rust
docs.rs/predicates
Apache License 2.0
173 stars 29 forks source link

fix: make Predicate::eval for isClosePredicate work with latest float… #79

Closed 0x-r4bbit closed 5 years ago

0x-r4bbit commented 5 years ago

…-cmp

The float-cmp crate has introduced a breaking change in its approx_eq() API in https://github.com/mikedilger/float-cmp/commit/d93fe51aa928cfdb269af67331846d533e850ec4 which was released as a feature release with version 0.4.1 in https://github.com/mikedilger/float-cmp/commit/edb0717fefe8e5896d239e4354f7bfaaac91133f

Since it's a minor version bump, it gets included in predicate-rs' dependency range, breaking many people's code.

This commit adjust predicate-rs' source to comply with the latest API changes.

Closes #78 and https://github.com/mikedilger/float-cmp/issues/17

0x-r4bbit commented 5 years ago

Another option would be reduce the version range to be exact 0.4.0. Either way is fine I think?

epage commented 5 years ago

My main question is if there is a way to implement this that is happy with both versions of float-cmp.

If not, I want to hold off until float-cmp is yanked. This is a bug in float-cmp and should be addressed there and if we address it here and they yank, then we are still broken.

I'll keep an eye on https://github.com/mikedilger/float-cmp/issues/17 and if it isn't addressed soon, then we can look into someting

0x-r4bbit commented 5 years ago

Fair enough, thanks for the feedback!!

epage commented 5 years ago

Thanks for contributing even if it isn't going in (for now)!

mikedilger commented 5 years ago

I'm terribly sorry for breaking float-cmp. I've yanked 0.4.1

0x-r4bbit commented 5 years ago

Closing this as resolved via https://github.com/mikedilger/float-cmp/issues/17#issuecomment-500572359