Skip to content

Internal if_chain! lints #7010

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

Merged
merged 2 commits into from
Mar 31, 2021
Merged

Internal if_chain! lints #7010

merged 2 commits into from
Mar 31, 2021

Conversation

camsteffen
Copy link
Contributor

changelog: none

We use if_chain! a lot. So this enforces some style rules around it, internal only.

Lints when...

  • Nested if/if_chain! can be collapsed
  • An if_chain! starts with let or ends with let ..; then {..}
  • An if_chain! has only one if
  • An if_chain! contains if .. && ..; that spans multiple lines

@rust-highfive
Copy link

r? @llogiq

(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 Mar 31, 2021
@llogiq
Copy link
Contributor

llogiq commented Mar 31, 2021

That's a lot of dogfood...yummy. 😆 Thank you! @bors r+

@bors
Copy link
Contributor

bors commented Mar 31, 2021

📌 Commit 827d6aa has been approved by llogiq

@bors
Copy link
Contributor

bors commented Mar 31, 2021

⌛ Testing commit 827d6aa with merge 8cf7d9b...

@bors
Copy link
Contributor

bors commented Mar 31, 2021

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: llogiq
Pushing 8cf7d9b to master...

@bors bors merged commit 8cf7d9b into rust-lang:master Mar 31, 2021
@flip1995
Copy link
Member

This is great! Thanks!

@camsteffen camsteffen deleted the if-chain-lint branch March 31, 2021 23:35
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.

5 participants