orx-iterable 1.3.0

Defines and implements Iterable, Collection and CollectionMut traits to represent types that can be iterated over multiple times.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::obj_safe::IterableObj;
use crate::{transformations::Copied, Iterable};
use std::boxed::Box;

impl<'a, T, I> IterableObj for Copied<'a, T, I>
where
    I: Iterable<Item = &'a T>,
    T: Copy + 'a,
{
    type Item = T;

    fn boxed_iter(&self) -> Box<dyn Iterator<Item = Self::Item> + '_> {
        Box::new(self.iter())
    }
}