From c7305e6bd7ad989bf91d5677ece073500cdbc44d Mon Sep 17 00:00:00 2001 From: Flamenco Date: Sun, 29 Sep 2024 02:50:30 -0400 Subject: [PATCH] Update iter.md Clarify that the associated type is also required by the trait. --- src/trait/iter.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/trait/iter.md b/src/trait/iter.md index db773123c0..611c18b579 100644 --- a/src/trait/iter.md +++ b/src/trait/iter.md @@ -17,7 +17,8 @@ struct Fibonacci { } // Implement `Iterator` for `Fibonacci`. -// The `Iterator` trait only requires a method to be defined for the `next` element. +// The `Iterator` trait only requires a method to be defined for the `next` element, +// and an `associated type` to declare the return type of the iterator. impl Iterator for Fibonacci { // We can refer to this type using Self::Item type Item = u32;