1 #![feature(tool_lints)]
3 #![warn(clippy::copy_iterator)]
8 impl Iterator for Countdown {
11 fn next(&mut self) -> Option<u8> {
12 self.0.checked_sub(1).map(|c| {
20 let my_iterator = Countdown(5);
21 let a: Vec<_> = my_iterator.take(1).collect();
22 assert_eq!(a.len(), 1);
23 let b: Vec<_> = my_iterator.collect();
24 assert_eq!(b.len(), 5);