Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use .iter() instead of (&values).into_iter() #2519

Merged
merged 1 commit into from
Dec 16, 2024
Merged

Conversation

randomPoison
Copy link
Collaborator

The (&values).into_iter() construct used in the solution to the iterators exercise is kind of awkward and always gets questions from students. I think the better thing would be to use the iter method to get the initial iterator, as that's the more idiomatic way to. It's also an opportunity to point out that there are helper methods for getting an iterator for a collection.

@djmitche djmitche merged commit 2e8d5d3 into main Dec 16, 2024
37 checks passed
@djmitche djmitche deleted the legare/use-iter-method branch December 16, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants