Add more clippy rules#8183
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdds four new Clippy ChangesClippy lint enforcement and code fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/stdlib/src/json.rs (1)
167-183: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winKeep
parse_constantcallback arguments as strings.Line 172 now forwards
b"NaN"/b"Infinity"/b"-Infinity"intoself.parse_constant.call(...), so this path passes Pythonbytesinstead of thestrtokens thatcall_scan_oncestill uses at Lines 594, 599, and 605. That breaks the callback contract for these constants depending on which scanner path is taken.Proposed fix
macro_rules! parse_constant { - ($s:literal) => { - if rest.starts_with($s) { + ($bytes:literal, $token:literal) => { + if rest.starts_with($bytes) { return Ok(PyIterReturn::Return( vm.new_tuple(( - self.parse_constant.call(($s,), vm)?, - char_idx + $s.len(), + self.parse_constant.call(($token,), vm)?, + char_idx + $bytes.len(), )) .into(), )); } }; } - parse_constant!(b"NaN"); - parse_constant!(b"Infinity"); - parse_constant!(b"-Infinity"); + parse_constant!(b"NaN", "NaN"); + parse_constant!(b"Infinity", "Infinity"); + parse_constant!(b"-Infinity", "-Infinity");🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/stdlib/src/json.rs` around lines 167 - 183, The parse_constant callback in json scanning is receiving bytes for NaN/Infinity/-Infinity, which breaks the existing string-based contract. Update the constant parsing path in the macro in json.rs so `self.parse_constant.call(...)` is passed string tokens instead of byte literals, matching the `call_scan_once` paths and keeping `parse_constant` consistent across all scanner entry points.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@crates/stdlib/src/json.rs`:
- Around line 167-183: The parse_constant callback in json scanning is receiving
bytes for NaN/Infinity/-Infinity, which breaks the existing string-based
contract. Update the constant parsing path in the macro in json.rs so
`self.parse_constant.call(...)` is passed string tokens instead of byte
literals, matching the `call_scan_once` paths and keeping `parse_constant`
consistent across all scanner entry points.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 8424896a-357f-42eb-a11f-ce26e1fe854b
📒 Files selected for processing (13)
Cargo.tomlcrates/codegen/src/compile.rscrates/codegen/src/symboltable.rscrates/common/src/float_ops.rscrates/common/src/hash.rscrates/common/src/int.rscrates/stdlib/src/json.rscrates/vm/src/builtins/bytes.rscrates/vm/src/function/builtin.rscrates/vm/src/getpath.rscrates/vm/src/types/slot.rscrates/vm/src/vm/mod.rscrates/vm/src/vm/vm_new.rs
This reverts commit f40f756.
Summary
Summary by CodeRabbit