首页 > TAG信息列表 > CountdownIterator

rust iter3

struct CountdownIterator(i32); impl Iterator for CountdownIterator { type Item = i32; fn next(&mut self) -> Option<Self::Item> { self.0 -= 1; if self.0 < 0 { None } else { Some(self.