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 to "1.0.85" changes behaviour #920

Open
andrewdavidmackenzie opened this issue Aug 22, 2022 · 1 comment
Open

Update to "1.0.85" changes behaviour #920

andrewdavidmackenzie opened this issue Aug 22, 2022 · 1 comment

Comments

@andrewdavidmackenzie
Copy link

andrewdavidmackenzie commented Aug 22, 2022

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?

@Keats
Copy link

Keats commented Sep 19, 2022

Is that change expected?

Yes: #919

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants