Remove `float-cmp` crate
jcamiel opened this issue · 0 comments
jcamiel commented
float-cmp
crate is used in one place in Hurl to check the comparison between two f64
We can do a "classic" float comparison as clippy suggests https://rust-lang.github.io/rust-clippy/rust-1.72.0/index.html#/float_cmp and remove float-cmp
from
let error_margin = f64::EPSILON; // Use an epsilon for comparison
// Or, if Rust <= 1.42, use `std::f64::EPSILON` constant instead.
// let error_margin = std::f64::EPSILON;
if (y - 1.23f64).abs() < error_margin { }
if (y - x).abs() > error_margin { }
Note: we compare f64
for predicate value here
hurl/packages/hurl/src/runner/number.rs
Lines 32 to 40 in 07512a9
so there is no reason to use
float-cmp
in jsonpath module