Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed impl to use Self::Item #1425

Merged
merged 2 commits into from
Mar 22, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/trait/iter.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl Iterator for Fibonacci {
// The return type is `Option<T>`:
// * When the `Iterator` is finished, `None` is returned.
// * Otherwise, the next value is wrapped in `Some` and returned.
fn next(&mut self) -> Option<u32> {
fn next(&mut self) -> Option<Self::Item> {
Stromberg90 marked this conversation as resolved.
Show resolved Hide resolved
let new_next = self.curr + self.next;

self.curr = self.next;
Expand Down