Fix off by one

This commit is contained in:
Eryn Wells 2016-12-20 17:52:00 -08:00
parent 08bbaeb7cf
commit 837403949e

View file

@ -56,7 +56,7 @@ impl RelativeIndexable for str {
fn index_after(&self, index: &usize) -> usize {
let mut next_index = index + 1;
if next_index > self.len() {
if next_index >= self.len() {
return self.len();
}
while !self.is_char_boundary(next_index) {