Fix off by one
This commit is contained in:
parent
08bbaeb7cf
commit
837403949e
1 changed files with 1 additions and 1 deletions
|
@ -56,7 +56,7 @@ impl RelativeIndexable for str {
|
||||||
|
|
||||||
fn index_after(&self, index: &usize) -> usize {
|
fn index_after(&self, index: &usize) -> usize {
|
||||||
let mut next_index = index + 1;
|
let mut next_index = index + 1;
|
||||||
if next_index > self.len() {
|
if next_index >= self.len() {
|
||||||
return self.len();
|
return self.len();
|
||||||
}
|
}
|
||||||
while !self.is_char_boundary(next_index) {
|
while !self.is_char_boundary(next_index) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue