pubstructFibonacci{pubcurr:usize,
pubnext:usize,
}// Implement `Iterator` for `Fibonacci`.
implIterator forFibonacci{typeItem=usize;// Define how to compute the next step.
fnnext(&mutself)->Option<Self::Item>{let current =self.curr;self.curr =self.next;self.next = current +self.next;Some(current)}}