don't count the terminator in PStrIter len

This commit is contained in:
Mark Thom
2020-04-15 10:07:44 -06:00
parent af14832b6c
commit 6d7b14ceb5
2 changed files with 2 additions and 1 deletions

View File

@@ -200,7 +200,7 @@ impl PartialString {
#[inline]
pub fn range_from(&self, index: RangeFrom<usize>) -> PStrIter {
PStrIter::from(self.buf, self.len, index.start)
PStrIter::from(self.buf, self.len - '\u{0}'.len_utf8(), index.start)
}
#[inline]