unicodedata: Const, embedded version#8131
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthrough
ChangesUnicode Version Flag Refactor
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@crates/stdlib/build.rs`:
- Around line 659-664: The escaped quotes in the println! macro's format string
are causing literal quote characters to be embedded in the RUST_UNICODE_VERSION
environment variable value. Remove the `\"` escape sequences from the format
string so that the version string contains only the numeric value without
literal quotes. The format string should output the version directly as `15.1.0`
rather than `"15.1.0"`.
In `@crates/stdlib/src/unicodedata.rs`:
- Line 486: The digit() method at line 486 is hardcoding true as the modern flag
in the lookup_numeric_val(ch, true) call, while the decimal() and numeric()
methods both use lookup_numeric_val(ch, self.modern). This inconsistency means
digit() will always use modern tables regardless of the Unicode version. Change
the hardcoded true to self.modern in the digit() method's lookup_numeric_val()
call to match the consistent behavior used in decimal() and numeric().
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: fca68cc1-521d-46c8-961b-917baeb34e36
📒 Files selected for processing (2)
crates/stdlib/build.rscrates/stdlib/src/unicodedata.rs
5a42103 to
6315476
Compare
|
I'm not sure the Windows test failed on something completely unrelated to this patch. 🤔 |
I've restarted it |
ShaharNaveh
left a comment
There was a problem hiding this comment.
I like this cleanup!
tysm:)
Summary
unicodedata's version can be const evaluated and doesn't need to allocate.Summary by CodeRabbit
unidata_version), aligning it across module and instance accessors.