Function roll

Source
pub fn roll<T: Clone>(vec: &mut Vec<T>, offset: isize)
Expand description

Roll over the entries from the end of a vector to the beginning by a given offset.

This is similar to https://numpy.org/doc/2.2/reference/generated/numpy.roll.html

ยงArguments:

  • vec : The vector to be rolled over. It will be changed in place
  • offset: The signed number to shift elements by (can be to the left or right)