You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let s = "abcd";
let mut cursor = GraphemeCursor::new(2, s.len(), true);
assert_eq!(cursor.prev_boundary(&s[2..], 2), Err(GraphemeIncomplete::PrevChunk));
assert_eq!(cursor.prev_boundary(&s[..2], 2), Ok(Some(1));
Currently it crashes during the first assertion, since prev_boundary expects at least there's one character from the chunk start to the cursor position.
The text was updated successfully, but these errors were encountered:
jmuk
added a commit
to jmuk/unicode-segmentation
that referenced
this issue
Mar 16, 2018
It'd be good if the following code works.
Currently it crashes during the first assertion, since
prev_boundary
expects at least there's one character from the chunk start to the cursor position.The text was updated successfully, but these errors were encountered: