oxilean_std/fin/
finiter_traits.rs1use super::types::{Fin, FinIter};
13
14impl Iterator for FinIter {
15 type Item = Fin;
16 fn next(&mut self) -> Option<Self::Item> {
17 if self.current < self.bound {
18 let f = Fin {
19 val: self.current,
20 bound: self.bound,
21 };
22 self.current += 1;
23 Some(f)
24 } else {
25 None
26 }
27 }
28 fn size_hint(&self) -> (usize, Option<usize>) {
29 let remaining = self.bound - self.current;
30 (remaining, Some(remaining))
31 }
32}
33
34impl ExactSizeIterator for FinIter {}