orx_iterable/producing_iterables/
range.rs

1use crate::Iterable;
2use core::ops::Range;
3
4macro_rules! impl_for_range_of {
5    ($T:ty) => {
6        impl Iterable for Range<$T> {
7            type Item = $T;
8
9            type Iter = Self;
10
11            fn iter(&self) -> Self::Iter {
12                self.clone()
13            }
14        }
15    };
16}
17
18impl_for_range_of!(usize);
19impl_for_range_of!(u128);
20impl_for_range_of!(u64);
21impl_for_range_of!(u32);
22impl_for_range_of!(u16);
23impl_for_range_of!(u8);
24impl_for_range_of!(isize);
25impl_for_range_of!(i128);
26impl_for_range_of!(i64);
27impl_for_range_of!(i32);
28impl_for_range_of!(i16);
29impl_for_range_of!(i8);