1 unstable release
Uses old Rust 2015
0.1.0 | Oct 18, 2018 |
---|
#90 in #quick
11KB
149 lines
A Range
Write quick and explict ranges in Rust
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
lib.rs
:
Create ranges in a very explicit manner
Start with the [from()
] function and build up a range using From::up_to
or
From::down_to
.
Examples
extern crate a_range;
let x = a_range::from(5).up_to(7);
assert_eq!(x.to_vec(), vec![5, 6, 7]);
let x = a_range::from(3).down_to(1);
assert_eq!(x.to_vec(), vec![3, 2, 1]);
Dependencies
~150KB