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 · 0 comments
Open

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

truchi opened this issue May 29, 2024 · 0 comments

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!

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