A struct containing f32 or f64 can result in the following clippy warning strict comparison of 'f32' or 'f64'.
Add an option to #[difference] (both at the struct and field level) that allows for an error margin.
If this value is present, compare value a to value b within the specified error margin: (x - y).abs() < ERROR_MARGIN.
Otherwise, keep a == b and add #[allow(clippy::float_cmp)] to suppress clippy warnings.
If the error margin is present at the struct level, it is propagated to its (float) fields, unless a field has a specific error margin provided via #[difference].
A struct containing
f32orf64can result in the following clippy warning strict comparison of 'f32' or 'f64'.Add an option to
#[difference](both at the struct and field level) that allows for an error margin.If this value is present, compare value
ato valuebwithin the specified error margin:(x - y).abs() < ERROR_MARGIN.Otherwise, keep
a == band add#[allow(clippy::float_cmp)]to suppress clippy warnings.If the error margin is present at the struct level, it is propagated to its (float) fields, unless a field has a specific error margin provided via
#[difference].