Example:
struct IntContainer(Vec<i32>);
impl<'a> IntoIterator for &'a IntContainer {
type IntoIter = std::iter::Copied<std::slice::Iter<'a, i32>>;
type Item = i32;
fn into_iter(self) -> Self::IntoIter {
self.0.iter().copied()
}
}
// I expect to be able to write:
let c = IntContainer(vec![1,2,3]);
assert_that!(c, elements_are![eq(1), eq(2), eq(3)]);