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 a clippy::collapsible_match lint #2642

Merged
merged 1 commit into from
Aug 19, 2021
Merged

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Aug 19, 2021

Motivation

Clippy is suggesting that we collapse a nested match ... { if let ... { ... } }.

However, the suggestion is actually wrong:
rust-lang/rust-clippy#7575

This lint only seems to be on nightly right now, but eventually it will cause our CI to fail.

Solution

  • remove the nested match, preserving behaviour

Review

Anyone can review this tiny fix.

Reviewer Checklist

  • Existing tests pass

We don't use the suggestion here, because it's actually wrong.
See rust-lang/rust-clippy#7575
@teor2345 teor2345 added this to the 2021 Sprint 16 milestone Aug 19, 2021
@teor2345 teor2345 requested a review from a team August 19, 2021 03:44
@teor2345 teor2345 self-assigned this Aug 19, 2021
@teor2345 teor2345 added A-rust Area: Updates to Rust code C-cleanup Category: This is a cleanup P-Low and removed P-Low labels Aug 19, 2021
Copy link
Collaborator

@conradoplg conradoplg left a comment

Choose a reason for hiding this comment

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

LGTM

@conradoplg conradoplg merged commit 6a84094 into main Aug 19, 2021
@conradoplg conradoplg deleted the clippy-collapsible-match branch August 19, 2021 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rust Area: Updates to Rust code C-cleanup Category: This is a cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants