Skip to content

Enable decimal_floats by default for Value::Number(Float) roundtrip#363

Merged
juntyr merged 3 commits into
ron-rs:masterfrom
juntyr:value-float-roundtrip
Feb 19, 2022
Merged

Enable decimal_floats by default for Value::Number(Float) roundtrip#363
juntyr merged 3 commits into
ron-rs:masterfrom
juntyr:value-float-roundtrip

Conversation

@juntyr

@juntyr juntyr commented Jan 28, 2022

Copy link
Copy Markdown
Member
  • I've included my change in CHANGELOG.md

Fixes #337

@juntyr

juntyr commented Jan 28, 2022

Copy link
Copy Markdown
Member Author

?r @torkleyy This PR simply makes decimal_floats on by default
(a) as it fixes #337 as integer floats are now serialized as decimals by default
(b) imo it also looks nicer

@juntyr juntyr mentioned this pull request Feb 2, 2022

@kvark kvark left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it even need to be an option?
I would think just removing the option entirely and doing this unconditionally would be better.

@juntyr

juntyr commented Feb 19, 2022

Copy link
Copy Markdown
Member Author

@kvark Does it even need to be an option? I would think just removing the option entirely and doing this unconditionally would be better.

That's a good idea - thanks for the suggestion! This commit will of course require a version bump as it is a breaking change, though I guess the usefulness of not including a decimal was questionable from the start.

@juntyr juntyr merged commit 7092d0e into ron-rs:master Feb 19, 2022
@juntyr juntyr deleted the value-float-roundtrip branch February 19, 2022 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Round-trip failure: ser -> de transforms Float(1.0) into Integer(1)

2 participants