Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify date parser #4143

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

CrazyboyQCD
Copy link
Contributor

  • Avoid allocation if string is ascii
  • Return early if string from utf16 encoded JsString is not ascii
  • Replace Char<'_> with slice::Iter<'_, u8>
  • Add next_n_digits helper method to save calls of next_digit
  • Merge duplicate codes in matches

@CrazyboyQCD CrazyboyQCD force-pushed the simplify-date-parser branch 3 times, most recently from 6b320c6 to d82795c Compare January 24, 2025 06:30
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 72.09302% with 24 lines in your changes missing coverage. Please review.

Project coverage is 53.67%. Comparing base (6ddc2b4) to head (51974b7).
Report is 364 commits behind head on main.

Files with missing lines Patch % Lines
core/engine/src/builtins/date/utils.rs 72.09% 24 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4143      +/-   ##
==========================================
+ Coverage   47.24%   53.67%   +6.42%     
==========================================
  Files         476      487      +11     
  Lines       46892    51811    +4919     
==========================================
+ Hits        22154    27808    +5654     
+ Misses      24738    24003     -735     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@nekevss nekevss left a comment

Choose a reason for hiding this comment

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

Looks good to me at a high level. I like the move from char to u8 ascii. I have a suggestion.

core/engine/src/builtins/date/utils.rs Outdated Show resolved Hide resolved
@nekevss nekevss requested a review from a team January 25, 2025 01:24
@nekevss nekevss added the builtins PRs and Issues related to builtins/intrinsics label Jan 25, 2025
@CrazyboyQCD CrazyboyQCD force-pushed the simplify-date-parser branch 4 times, most recently from 84bb6bb to 3cd4ac0 Compare January 25, 2025 09:56
@CrazyboyQCD CrazyboyQCD requested a review from nekevss January 26, 2025 02:05
@CrazyboyQCD CrazyboyQCD force-pushed the simplify-date-parser branch 3 times, most recently from 6014688 to d430a23 Compare January 31, 2025 07:16
@CrazyboyQCD CrazyboyQCD force-pushed the simplify-date-parser branch 2 times, most recently from 35451f2 to cff9047 Compare February 8, 2025 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builtins PRs and Issues related to builtins/intrinsics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants