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

Fix replacing for loops over ranges with for_each. #10139

Merged
merged 2 commits into from
Sep 3, 2021
Merged

Fix replacing for loops over ranges with for_each. #10139

merged 2 commits into from
Sep 3, 2021

Conversation

yotamofek
Copy link
Contributor

@yotamofek yotamofek commented Sep 3, 2021

Previously, the assist would turn this:

for x in 0..92 {
    ...
}

into the syntactically incorrect code below:

0..92.for_each(|x| ...)

This fixes the assist by parenthesizing range expressions.

@yotamofek
Copy link
Contributor Author

This partially fixes #8367

@matklad
Copy link
Member

matklad commented Sep 3, 2021

👍

bors d+

@bors
Copy link
Contributor

bors bot commented Sep 3, 2021

✌️ yotamofek can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
@yotamofek
Copy link
Contributor Author

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 3, 2021

@bors bors bot merged commit 5506e0d into rust-lang:master Sep 3, 2021
@lnicola
Copy link
Member

lnicola commented Sep 3, 2021

changelog fix (first contribution) fix for loop to for_each conversion with range expressions

This pull request was closed.
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.

3 participants