Crates.io | in_range |
lib.rs | in_range |
version | 0.1.0 |
source | src |
created_at | 2023-01-25 21:30:50.881641 |
updated_at | 2023-01-25 21:30:50.881641 |
description | Returns true if a number is in range |
homepage | https://github.com/njshockey/in-range-rs |
repository | https://github.com/njshockey/in-range-rs.git |
max_upload_size | |
id | 767969 |
size | 16,347 |
A Rust library to return true if a number is in range.
First, install the library with
cargo add in_range
Then, in code:
use in_range::in_range;
// Args: value, min, max
let result = in_range(10, 1, 15);
print!("{}", result);
// Prints true;
You can also use not_in_range
to return false when value is in range.
use in_range::not_in_range;
// Args: value, min, max
let result = not_in_range(25, 1, 15);
print!("{}", result);
// Prints true;
In range uses the Rust standard MIT/Apache-2.0 dual license for best compatibility. See LICENSE-APACHE.txt and LICENSE-MIT.txt for the full licenses.