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

single_match: suggest if over if let when possible #6574

Merged
merged 3 commits into from
Jan 15, 2021

Conversation

Jarcho
Copy link
Contributor

@Jarcho Jarcho commented Jan 11, 2021

fixes: #173
changelog: single_match: suggest if over if let when possible

@rust-highfive
Copy link

r? @Manishearth

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 11, 2021
@Jarcho Jarcho changed the title single_match: suggest if over if let when possible single_match: suggest if over if let when possible Jan 11, 2021
Copy link
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good, minor changes

clippy_lints/src/matches.rs Outdated Show resolved Hide resolved
tests/ui/single_match.rs Outdated Show resolved Hide resolved
clippy_lints/src/matches.rs Outdated Show resolved Hide resolved
clippy_lints/src/matches.rs Outdated Show resolved Hide resolved
Add: attempt to remove address of expressions from the scrutinee expression before adding references to the pattern
clippy_lints/src/utils/mod.rs Outdated Show resolved Hide resolved
@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 15, 2021

📌 Commit 36ff2f7 has been approved by Manishearth

@bors
Copy link
Collaborator

bors commented Jan 15, 2021

⌛ Testing commit 36ff2f7 with merge 2d1e129...

@bors
Copy link
Collaborator

bors commented Jan 15, 2021

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Manishearth
Pushing 2d1e129 to master...

@bors bors merged commit 2d1e129 into rust-lang:master Jan 15, 2021
@Jarcho Jarcho deleted the single_match_eq branch April 6, 2021 16:02
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.

single_match should suggest plain if when possible
5 participants