Skip to main content

wrap_prev

Function wrap_prev 

Source
pub fn wrap_prev(current: usize, len: usize) -> usize
Expand description

Previous index in a list, wrapping around to len - 1 from index 0. Returns 0 if len is 0.