From 7de335a05670edbd0108f6d4c2d4b722753cd318 Mon Sep 17 00:00:00 2001 From: Max Niederman Date: Wed, 2 Mar 2022 20:42:38 -0800 Subject: [PATCH] update ch13-02 to reflect changes in #2797 Before Rust 1.53, arrays did not implement `IntoIterator`, so listing 5-3 manually called `iter` to iterate over one using a `for` loop. PR #2797 changed this, but did not update the wording in Chapter 13 Section 2 to reflect this change, creating a contradiction. --- src/ch13-02-iterators.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ch13-02-iterators.md b/src/ch13-02-iterators.md index 070a33011b..cc9d16e5f4 100644 --- a/src/ch13-02-iterators.md +++ b/src/ch13-02-iterators.md @@ -18,8 +18,9 @@ useful. Listing 13-13: Creating an iterator Once we’ve created an iterator, we can use it in a variety of ways. In Listing -3-5 in Chapter 3, we used iterators with `for` loops to execute some code on -each item, although we glossed over what the call to `iter` did until now. +3-5 in Chapter 3, we iterated over an array using a `for` loop to execute some +code on each of its items. Under the hood this implicitly created and then +consumed an iterator, but we glossed over how exactly that works until now. The example in Listing 13-14 separates the creation of the iterator from the use of the iterator in the `for` loop. The iterator is stored in the `v1_iter`