1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//! Wrapping slices and arrays.
//!
//! The data structures defined here wrap around their length. This is done by
//! always taking the index modulo the length of the structure.
//!
//! # Example
//! ```
//! use wrapping::WrappingSlice;
//!
//! let array: [&str; 1] = ["hello"];
//! let wrapping = WrappingSlice::from(&array[..]);
//!
//! assert_eq!(wrapping[0], "hello");
//! assert_eq!(wrapping[1], "hello");
//! ```
#![deny(missing_docs)]
#![deny(clippy::all)]

#[cfg(feature = "array")]
mod array;

#[cfg(feature = "array")]
pub use array::WrappingArray;

mod slice;
pub use slice::WrappingSlice;