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

next_boundary() panics when cursor is at the end of the given chunk #135

Open
truchi opened this issue May 29, 2024 · 1 comment
Open

next_boundary() panics when cursor is at the end of the given chunk #135

truchi opened this issue May 29, 2024 · 1 comment

Comments

@truchi
Copy link

truchi commented May 29, 2024

Hello,

In prev_boundary we have this check (for the following unwrap not to panic):

if self.offset == chunk_start {
    return Err(GraphemeIncomplete::PrevChunk);
}

I suggest this in next_boundary() (for the same reason):

if self.offset == chunk_start + chunk.len() {
    return Err(GraphemeIncomplete::NextChunk);
}

Thank you!

@truchi
Copy link
Author

truchi commented Nov 21, 2024

Wandering back here, it looks like master fixed this.

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

No branches or pull requests

1 participant