We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
match
Warn on a nested match that can be merged.
Option
Result
match token { Ok(token) => match token { Token::A | Token::B => { ... } } Err(err) => {} }
Could be written as:
match token { Ok(Token::A | Token::B) => { ... } Err(err) => {} }
The text was updated successfully, but these errors were encountered:
This sounds like what the collapsible_match lint looks for. That lint should probably be extended to catch this
collapsible_match
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
What it does
Warn on a nested match that can be merged.
Advantage
Drawbacks
Option
/Result
).Example
Could be written as:
The text was updated successfully, but these errors were encountered: