Skip to content

ci: fix lint with rust 1.99 - #309

Merged
davidhewitt merged 2 commits into
mainfrom
dh/lints-1.99
Oct 15, 2026
Merged

davidhewitt merged 2 commits into
mainfrom
dh/lints-1.99

Conversation

@davidhewitt

@davidhewitt davidhewitt commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary by cubic

Fixes Rust 1.99 lint failures and aligns invalid UTF-8 error positions with the latest serde_json.

  • Replaces is_empty() assertions in value.rs tests with assert_eq! comparisons against empty slices.
  • Adjusts InvalidUnicodeCodePoint error index accounting in string_decoder.rs and updates affected tests to match serde_json 1.0.154 behavior.
  • Bumps the serde_json dev-dependency to 1.0.154 and adds an invalid_utf8_position test.

Migration

  • The invalid UTF-8 error index is now reported at the first invalid byte rather than one byte later, matching serde_json.

Written for commit 4556a93. Summary will update on new commits.

View guided diff Turn on auto-fix

@davidhewitt
davidhewitt enabled auto-merge (squash) October 15, 2026 09:12

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 1 file

Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack

View guided diff | Turn on auto-fix | Re-trigger cubic

@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 1.04%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 64 untouched benchmarks
⏩ 2 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ python_parse_numeric 1.3 µs 1.5 µs -11.22%
⚡ true_array_jiter_value 2.6 µs 2.3 µs +10.32%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing dh/lints-1.99 (4556a93) with main (c03ab2f)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Comment thread crates/jiter/src/string_decoder.rs Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 4 reviewed files. 1 file intentionally excluded from review.

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="crates/jiter/src/string_decoder.rs">

<violation number="1" location="crates/jiter/src/string_decoder.rs:230">
P2: Map `e.valid_up_to()` from the decoded tape back to the original JSON string before adding it to `start`; a length-changing escape otherwise reports the wrong source index.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

View guided diff | Turn on auto-fix | Re-trigger cubic

Ok(unsafe { from_utf8_unchecked(&bytes[..valid_up_to]) })
}
Err(e) => Err(json_error!(InvalidUnicodeCodePoint, start + e.valid_up_to() + 1)),
Err(e) => Err(json_error!(InvalidUnicodeCodePoint, start + e.valid_up_to())),

@cubic-dev-ai cubic-dev-ai Bot Oct 15, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Map e.valid_up_to() from the decoded tape back to the original JSON string before adding it to start; a length-changing escape otherwise reports the wrong source index.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At crates/jiter/src/string_decoder.rs, line 230:

<comment>Map `e.valid_up_to()` from the decoded tape back to the original JSON string before adding it to `start`; a length-changing escape otherwise reports the wrong source index.</comment>

<file context>
@@ -227,7 +227,7 @@ fn to_str(bytes: &[u8], ascii_only: bool, start: usize, allow_partial: bool) ->
                 Ok(unsafe { from_utf8_unchecked(&bytes[..valid_up_to]) })
             }
-            Err(e) => Err(json_error!(InvalidUnicodeCodePoint, start + e.valid_up_to() + 1)),
+            Err(e) => Err(json_error!(InvalidUnicodeCodePoint, start + e.valid_up_to())),
         }
     }
</file context>
Fix with cubic

@davidhewitt
davidhewitt merged commit 4c8fa34 into main Oct 15, 2026
29 of 30 checks passed
@davidhewitt
davidhewitt deleted the dh/lints-1.99 branch October 15, 2026 10:34
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.

1 participant