docs(ch13-02): fix typo 'iteration' to 'iterator' in filter example (#4705)#4774
Open
Dodothereal wants to merge 1 commit into
Open
docs(ch13-02): fix typo 'iteration' to 'iterator' in filter example (#4705)#4774Dodothereal wants to merge 1 commit into
Dodothereal wants to merge 1 commit into
Conversation
Fixes rust-lang#4705 The line "the value will be included in the iteration produced by filter" should refer to "the iterator produced by filter", matching the surrounding paragraph's use of "iterator" and matching what filter actually returns (an iterator that lazily yields the chosen items). Verified against the current rendering on the stable book page: https://doc.rust-lang.org/stable/book/ch13-02-iterators.html#closures-that-capture-their-environment Only one word is changed. `dprint fmt` reports no further formatting changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4705
Summary
In
src/ch13-02-iterators.md, the sentence describing the result offilter:should read "the iterator produced by
filter".filterreturns an iterator that lazily yields the chosen items — not an "iteration". The surrounding paragraph already uses "iterator" consistently (e.g. "the closure gets an item from the iterator and returns abool"), so this single-word fix keeps the terminology aligned.Test plan
grep -n iteration src/ch13-02-iterators.mdshows only this one occurrence in thefilterexample ("the iteration produced byfilter"); other uses of "iteration" in the file (e.g. "one iteration of the loop", "when iteration is over", "the iteration behavior that theIteratortrait provides") are correct usages and are intentionally left untouched.dprint fmt src/ch13-02-iterators.md(the formatter the repo uses for Markdown perCONTRIBUTING.md) and confirmed there are no further formatting changes — the single-word fix is already dprint-clean.git diff --statreports1 file changed, 1 insertion(+), 1 deletion(-).AI assistance
Used an AI coding assistant (Claude Code) to identify the affected line, write the patch, and draft this PR description. The change itself is a single-word substitution that I verified by re-reading the affected paragraph and the file's other usages of "iteration" against
grep.