#step #range #less #index #indexed #expression #great

forangex

Range maker for foreward/backward and step may be larger than 1 (or less than -1), plus index support

4 releases

new 0.4.3 Nov 16, 2024
0.4.2 Nov 16, 2024
0.4.1 Nov 13, 2024
0.3.0 Nov 7, 2024

#1231 in Rust patterns

Download history 114/week @ 2024-11-06 270/week @ 2024-11-13

384 downloads per month

MIT/Apache

57KB
1.5K SLoC

rangex-rs

Clear range expression for exclusive/inclusive, forward/backward, and step great than 1 or less than -1, with index support


lib.rs:

This crate provides clear range expression for exclusive/inclusive, forward/backward, and step great than 1 or less than -1, with index support.

The most convenient way is to use the following macros:

range_inclusive!(start, stop)

This is the same as start..=stop

range_exclusive!(start, stop)

This is the same as start..stop

range_inclusive!(type, start, stop)

Creates range for type from start through stop, by step 1

range_inclusive!(type, start, stop, step)

Creates range for type from start through stop, by step

indexed_range_inclusive!(type, start, stop)

Creates indexed range for type from start through stop, by step 1

indexed_range_inclusive!(type, start, stop, step)

Creates indexed range for type from start through stop, by step

Dependencies

~465KB