Skip to content

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

Description

@truchi

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions