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

option_if_let_else: do not trigger on expressions returning () #11896

Merged
merged 1 commit into from Nov 30, 2023

Conversation

samueltardieu
Copy link
Contributor

Fix #11893

Trigerring on expressions returning () uses the arguments of the map_or_else() rewrite only for their side effects. This does lead to code which is harder to read than the original.

changelog: [option_if_let_else]: do not trigger on unit expressions

@rustbot
Copy link
Collaborator

rustbot commented Nov 29, 2023

r? @Alexendoo

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Nov 29, 2023
Fix rust-lang#11893

Trigerring on expressions returning `()` uses the arguments of the
`map_or_else()` rewrite only for their side effects. This does lead
to code which is harder to read than the original.
@Alexendoo
Copy link
Member

Agreed! @bors r+

@bors
Copy link
Collaborator

bors commented Nov 30, 2023

📌 Commit e3c73f1 has been approved by Alexendoo

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Nov 30, 2023

⌛ Testing commit e3c73f1 with merge 646b28f...

@bors
Copy link
Collaborator

bors commented Nov 30, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Alexendoo
Pushing 646b28f to master...

@bors bors merged commit 646b28f into rust-lang:master Nov 30, 2023
5 checks passed
@samueltardieu samueltardieu deleted the issue-11893 branch December 16, 2023 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

option_if_let_else: don't suggest map_or_else
4 participants