Closed bkc closed 3 months ago
Thanks for the suggestion. I think it's actually fine the way it is, though. The current version uses parallelism to describe first immutable and then mutable iterators in both parts: an A-B-A-B approach rather than an A-B-B-A approach (where A = immutable and B = mutable). If we made the change you suggest, it would pull the bits about mutability together, but push the bits about immutable iterators further away from each other—so someone else might show up with the exact opposite suggestion later! Thanks.
I have searched open and closed issues and pull requests for duplicates, using these search terms:
I have checked the latest
main
branch to see if this has already been fixed, in this file:URL to the section(s) of the book with this problem: https://github.com/rust-lang/book/blob/main/src/ch13-02-iterators.md
Description of the problem:
In the paragraph immediately preceding level 3 header "Methods that Consume the Iterator" (around lines 95 to 100), the paragraph discusses immutable iterators, jumps to iterators that take ownership, then back to mutable iterators.
Would it be helpful to complete the comparison of immutable vs mutable iterators before mentioning iterators that take ownership?
Suggested fix: