pub fn fwd_rev_incl_range(
start: usize,
end: usize,
) -> impl Iterator<Item = usize>Expand description
Forward/reverse inclusive range. If start <= end, returns a forward iterator from start
to end, inclusive. Else, returns a reverse iterator from end to start, inclusive.
use aoclib_rs::iter::fwd_rev_incl_range;
assert_eq!(fwd_rev_incl_range(1, 3).collect::<Vec<_>>(), [1, 2, 3]);
assert_eq!(fwd_rev_incl_range(3, 1).collect::<Vec<_>>(), [3, 2, 1]);