Hacker News new | past | comments | ask | show | jobs | submit login

There is a `windows` iterator.

https://doc.rust-lang.org/std/primitive.slice.html#method.wi...

However, your code would not work as-is, since the window borrows the buffer, so `buffer[i]` cannot be written to. Further, there is no `windows_mut` to let you write to the end of the window, because that would let you get multiple mutable references to a given element.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: