wrapping_in_range 0.1.3

Wrapping arithmetic for any range
Documentation
# `wrapping_in_range`

<!--
NOTE: Do not edit this file, it is generated by `cargo-rdme` using this build: https://github.com/orium/cargo-rdme/pull/236#issuecomment-3357198468
edit `lib.rs` instead, then re-run `cargo rdme` to re-generate this file 
-->

<!-- cargo-rdme start -->

[![crates.io](https://img.shields.io/crates/v/wrapping_in_range?style=flat-square&logo=rust)](https://crates.io/crates/wrapping_in_range)
[![docs.rs](https://img.shields.io/badge/docs.rs-wrapping_in_range-blue?style=flat-square&logo=docs.rs)](https://docs.rs/wrapping_in_range)
![license](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue?style=flat-square)
![msrv](https://img.shields.io/badge/msrv-1.60-blue?style=flat-square&logo=rust)
[![github](https://img.shields.io/github/stars/nik-rev/wrapping-in-range)](https://github.com/nik-rev/wrapping-in-range)

Wrapping-in-range arithmetic for custom ranges via the [`WrappingInRange`](https://docs.rs/wrapping_in_range/latest/wrapping_in_range/struct.WrappingInRange.html) type

```toml
[dependencies]
wrapping_in_range = "0.1"
```

These arithmetic operations act just like `std`'s `.wrapping_sub()`, `.wrapping_add()`, etc. but for a custom user-provided range.

## Examples

```rust
use wrapping_in_range::WrappingInRange;

let w = |i: i16| WrappingInRange(i, -1..=1);

assert_eq!(
    [-2, -1, 0, 1, 2].map(|i| w(i) - 1),
    [ 0, 1, -1, 0, 1]
);
assert_eq!(
    [-2, -1, 0,  1, 2].map(|i| w(i) + 1),
    [-1,  0, 1, -1, 0]
);
```

<!-- cargo-rdme end -->