Closed KMikeeU closed 1 year ago
Yeah, in the current implementation is panicky here. I think yes, you should check the conditions before calling these functions. We could probably in the long run make them more robus by making them fallible.
In general the cursor APIs have some bugs and need more polish, unfortunately. I haven't had the time to look into that.
I stumbled upon an issue, where calling functions like
GraphemeCursor::is_boundary
would panic whenever the index is in the middle of a unicode sequence (ie the index is not at a 'char' boundary). For example:This panics at
is_boundary
:Is this crate supposed to handle such issues? Or are they supposed to be prevented by checking these conditions before calling functions that can panic?