Skip to content

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

@truchi

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions