Skip to content

Commit 4dafcae

Browse files
authored
Merge pull request #1887 from Flamenco/patch-1
Clarify that the associated type is also required by the Iterator trait
2 parents 6e0146a + c7305e6 commit 4dafcae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/trait/iter.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ struct Fibonacci {
1717
}
1818
1919
// Implement `Iterator` for `Fibonacci`.
20-
// The `Iterator` trait only requires a method to be defined for the `next` element.
20+
// The `Iterator` trait only requires a method to be defined for the `next` element,
21+
// and an `associated type` to declare the return type of the iterator.
2122
impl Iterator for Fibonacci {
2223
// We can refer to this type using Self::Item
2324
type Item = u32;

0 commit comments

Comments
 (0)