wrapping

Crates.iowrapping
lib.rswrapping
version0.2.0
sourcesrc
created_at2020-06-12 19:29:00.802791
updated_at2020-06-12 21:05:11.174742
descriptionWrapping slices and arrays
homepage
repositoryhttps://git.ureeves.com/ureeves/wrapping
max_upload_size
id253370
size6,886
Eduardo Leegwater Simões (ureeves)

documentation

https://docs.rs/wrapping

README

Docs Build Status

wrapping

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");
Commit count: 0

cargo fmt