do length check in PartialString::range_from
@@ -202,7 +202,11 @@ fn write_terminator_at(&mut self, index: usize) {
#[inline]
pub fn range_from(&self, index: RangeFrom<usize>) -> PStrIter {
+ if self.len >= '\u{0}'.len_utf8() {
PStrIter::from(self.buf, self.len - '\u{0}'.len_utf8(), index.start)
+ } else {
+ PStrIter::from(self.buf, 0, 0)
+ }
}
#[inline]
