fix: preserve shortest float output with non_trailing_zero - #243
Merged
liuq19 merged 1 commit intoSep 11, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #243 +/- ##
==========================================
+ Coverage 71.16% 71.23% +0.07%
==========================================
Files 42 42
Lines 9762 9786 +24
==========================================
+ Hits 6947 6971 +24
Misses 2815 2815 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
HerrCai0907
force-pushed
the
fix/non-trailing-zero-float-format
branch
2 times, most recently
from
September 11, 2026 05:00
2134835 to
8275937
Compare
HerrCai0907
force-pushed
the
fix/non-trailing-zero-float-format
branch
from
September 11, 2026 05:26
8275937 to
3f4b874
Compare
Co-authored-by: TRAE CLI <traecli@bytedance.com>
HerrCai0907
force-pushed
the
fix/non-trailing-zero-float-format
branch
from
September 11, 2026 05:44
3f4b874 to
4b3e644
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
f32integer fast path undernon_trailing_zeroto the safe prefix where it matches shortest-float JSON outputzmij::format_finiteand trim only a.0suffix for larger integral floatsf64to avoid incorrect large integer fast-path outputf32, scientific notation, andf64boundary casesTest
cargo test test_serialize_float_non_trailing_zerocargo test --features non_trailing_zero test_serialize_float_non_trailing_zerocargo fmt --checkNote:
cargo fmt --checkprints existing nightly-only rustfmt configuration warnings, but exits successfully.