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
* Add methods slice_ascii(), and get_ascii() to AsAsciiStr
* Add methods slice_ascii_mut() to AsMutasciiStr
The main use case is avoiding accidentally panicking by slicing a str
in the middle of a codepoint with AsciiStr::from_ascii(str[a..=b])
or AsciiChar::from(str[n]).
I had hoped to finally use RangeArgument, but almost nothing in std takes it
because they instead went for their own unstable and sealed trait (SliceIndex).
Converting between them is also impossible without going through trait objects.
SliceIndex is actually workable though, albeit with one wart (associated type).
Working with mutable slices is hairy as usual.
0 commit comments