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

collapsible_if shouldn't warn on else after multiple else if #1401

Closed
leoyvens opened this issue Dec 23, 2016 · 1 comment
Closed

collapsible_if shouldn't warn on else after multiple else if #1401

leoyvens opened this issue Dec 23, 2016 · 1 comment

Comments

@leoyvens
Copy link

Consider:

if cond {
  ...
} else if cond1 {
  bar
} else if cond2 {
  ...
} else if cond3 {
  ...
} else {
  bar
}

This will trigger collapsible_if because of two equal bodies containing bar, but collapsing those ifs would be ugly and error prone, the code is idiomatic as it is.

@leoyvens leoyvens changed the title collapsible_if shouln't warn on else after multiple else if collapsible_if shouldn't warn on else after multiple else if Dec 23, 2016
@camsteffen
Copy link
Contributor

Could not reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants