orx_iterable/obj_safe/producing_iterables/
range.rs1use crate::obj_safe::IterableObj;
2use core::ops::Range;
3use std::boxed::Box;
4
5macro_rules! impl_for_range_of {
6 ($T:ty) => {
7 impl IterableObj for Range<$T> {
8 type Item = $T;
9
10 fn boxed_iter(&self) -> Box<dyn Iterator<Item = Self::Item> + '_> {
11 Box::new(self.clone())
12 }
13 }
14 };
15}
16
17impl_for_range_of!(usize);
18impl_for_range_of!(u128);
19impl_for_range_of!(u64);
20impl_for_range_of!(u32);
21impl_for_range_of!(u16);
22impl_for_range_of!(u8);
23impl_for_range_of!(isize);
24impl_for_range_of!(i128);
25impl_for_range_of!(i64);
26impl_for_range_of!(i32);
27impl_for_range_of!(i16);
28impl_for_range_of!(i8);