use crate::shapes::*; /// An iterator containing the shapes to display pub struct CircleShapes { modulo: u32, factor: u32, position: u32, circle: Circle, } impl CircleShapes { pub fn new(modulo: u32, factor: u32, circle: Circle) -> CircleShapes { CircleShapes { modulo, factor, position: 0, circle, } } } impl Iterator for CircleShapes { type Item = Shape; fn next(&mut self) -> Option { if self.position == 0 { self.position += 1; Some(Shape::Circle(self.circle)) } else { None } } }