don't count the terminator in PStrIter len

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

View File

@@ -31,6 +31,7 @@
:- use_module(library(dcgs)). :- use_module(library(dcgs)).
:- use_module(library(dif)). :- use_module(library(dif)).
:- use_module(library(format)).
:- use_module(library(lists)). :- use_module(library(lists)).
pl_resolution(Clauses0, Chain) :- pl_resolution(Clauses0, Chain) :-

View File

@@ -200,7 +200,7 @@ impl PartialString {
#[inline] #[inline]
pub fn range_from(&self, index: RangeFrom<usize>) -> PStrIter { 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] #[inline]