You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a recent (dependabot) update from 1.0.83 to 1.0.85 I am seeing a change in behaviour where values produced using json!() shift from being integers to being floats.
The output is the result of a division:
let dividend = inputs[0].as_f64().ok_or("Could not get dividend")?;
let divisor = inputs[1].as_f64().ok_or("Could not get divisor")?;
json!(dividend / divisor)
Output that before was "6" is now "6.0"?
So, maybe before it was "snapping" to an integer and now it always prints as a float?
Is that change expected?
It's quite possible this is now the "correct" behaviour, and I can easily change tests to work with it....but
Wouldn't such a change merit a minor semver version number bump (not just patch/micro)
I would do a rust playground code snippet to show the change...but don't think I can control versions used there?
The text was updated successfully, but these errors were encountered:
That has broken some unit tests of mine as well as some different output :/
Not a huge deal but it was probably worth a 1.1 since many people did use the Display impl to output text.
In a recent (dependabot) update from 1.0.83 to 1.0.85 I am seeing a change in behaviour where values produced using json!() shift from being integers to being floats.
The output is the result of a division:
Output that before was "6" is now "6.0"?
So, maybe before it was "snapping" to an integer and now it always prints as a float?
It's quite possible this is now the "correct" behaviour, and I can easily change tests to work with it....but
I would do a rust playground code snippet to show the change...but don't think I can control versions used there?
The text was updated successfully, but these errors were encountered: