Closed Zoxc closed 6 years ago
Similar example from rustc's tidy:
// If this path is in-tree, we don't require it to be on the whitelist
if must_be_on_whitelist {
// If this dependency is not on the WHITELIST, add to bad set
if !whitelist.contains(&krate.into()) {
unapproved.insert(krate.into());
}
}
Both of the if
statements have a comment, and collapsing them together would make this less clear.
I'd like to work on this if there is still interest.
Great, it's all yours. Also have a look at #3228, for some more discussion about this lint.
In this example there is comment which applies to both branches in the
else
block.