Crate wrapping

Source
Expand description

Wrapping around for slices.

Implements a wrapper around slices that allows for indexing beyond the length of the slice, by taking the index always modulo the length.

§Example

use wrapping::Wrapping;

let array: [&str; 1] = ["hello"];
let wrapping = Wrapping::from(&array[..]);

assert_eq!(wrapping[0], "hello");
assert_eq!(wrapping[1], "hello");

Structs§

MutWrapping
Wrapper around a mutable slice that allows for indexing out of bounds.
Wrapping
Wrapper around an immutable slice that allows for indexing out of bounds.