Closed
Description
As I saw in this code review, someone wrote:
while Some(&instructions[i]) == instructions[i + acc..].iter().next() {
acc += 1;
}
That should be replaced with:
while Some(&instructions[i]) == instructions.get(i + acc) {
acc += 1;
}
In general, slice[i..].iter().next()
can be replaced with slice.get(i)
, or 0
if there is no slicing done.