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

fix(core): Address UTF-8 character boundary issues in LineBreaker #3228

Conversation

iamchanii
Copy link
Contributor

@iamchanii iamchanii commented Dec 24, 2024

Summary:
This PR integrates the unicode-segmentation crate to address issues related to UTF-8 character boundaries in the LineBreaker struct. The changes ensure that string documentation is formatted safely without encountering byte index errors. The code now correctly iterates over grapheme clusters, thus maintaining valid character boundaries during string manipulation.

Before the change, the added test case causes a panic.

Issue Reference(s):
N/A

Build & Testing:

  • I ran cargo test successfully.
  • I have run ./lint.sh --mode=fix to fix all linting issues raised by ./lint.sh --mode=check.

Checklist:

  • I have added relevant unit & integration tests.
  • I have updated the documentation accordingly.
  • I have performed a self-review of my code.
  • PR follows the naming convention of <type>(<optional scope>): <title>

@github-actions github-actions bot added the type: fix Iterations on existing features or infrastructure. label Dec 24, 2024
@tusharmath
Copy link
Contributor

Thanks @iamchanii 🙌

@tusharmath tusharmath enabled auto-merge (squash) December 24, 2024 07:54
@tusharmath tusharmath disabled auto-merge December 24, 2024 21:35
@tusharmath tusharmath enabled auto-merge (squash) December 24, 2024 23:29
Copy link

codecov bot commented Dec 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.32%. Comparing base (4cf48a1) to head (cc76682).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3228      +/-   ##
==========================================
+ Coverage   86.30%   86.32%   +0.01%     
==========================================
  Files         282      282              
  Lines       28761    28798      +37     
==========================================
+ Hits        24823    24860      +37     
  Misses       3938     3938              

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

@tusharmath tusharmath merged commit e3a6026 into tailcallhq:main Dec 26, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: fix Iterations on existing features or infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants