Repository navigation
Conversation
The root parser (src/parser.rs) uses sonic_number::parse_float32 and sonic_number::parse_number_unchecked, both introduced in sonic-number 0.1.3. The loose version = "0.1" requirement allows Cargo to resolve to sonic-number 0.1.2 (e.g. when kept by an existing Cargo.lock), which makes the published sonic-rs 0.5.10 fail to build with E0432/E0425. Pin the requirement to "0.1.3" so Cargo selects at least sonic-number 0.1.3. Fixes cloudwego#246
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #261 +/- ##
=======================================
Coverage 73.36% 73.36%
=======================================
Files 42 42
Lines 10030 10030
=======================================
Hits 7359 7359
Misses 2671 2671 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
src/parser.rsimports and calls APIs that exist only since sonic-number 0.1.3:The root
Cargo.tomlhowever declares the dependency with a loose requirement:When the crate is published, the
path = "./sonic-number"is stripped and only theversion requirement remains. Because
"0.1"(^0.1.0) admits0.1.2, Cargo can keepan older locked
sonic-number 0.1.2(e.g. from a downstreamCargo.lock), which doesnot provide
parse_float32/parse_number_unchecked. This makes the publishedsonic-rs 0.5.10fail to build:This is exactly the report in #246.
Change
Tighten the requirement so Cargo resolves to at least sonic-number 0.1.3:
sonic-number 0.1.3is already the current sub-crate version in this repo and ispublished on crates.io (max_version = 0.1.3), so the path/local build is unaffected.
Risk
Low and localized: a single manifest version-bump. No source changes.
Testing
cargo check --lib(default features) — passescargo test --lib(default features) — 114 passed, 0 failedcargo check --lib --features utf8_lossy— passesRefs #246