Closed
Description
I got a sample code:
let s = "abcd";
let mut cursor = GraphemeCursor::new(3, s.len(), false);
assert_eq!(cursor.prev_boundary(&s[2..], 2), Err(GraphemeIncomplete::PrevChunk));
assert_eq!(cursor.prev_boundary(&s[..2], 0), Ok(Some(2)));
On the second assertion, it instead returns Err(GraphemeIncomplete::InvalidOffset)
. If it starts from position 4, as is written in the doc comment, it works. However it does not work when the cursor position starts from 3.
Metadata
Metadata
Assignees
Labels
No labels