Str::slice_chars() is O(end), not O(end - begin)
auto merge of #12708 : SimonSapin/rust/patch-6, r=huonw

Feel free to reject this if I’m mistaken, but the `count` in the for loop does look like it’s going from 0 to `end`.