1
Fork 0

Rollup merge of #130235 - compiler-errors:nested-if, r=michaelwoerister

Simplify some nested `if` statements

Applies some but not all instances of `clippy::collapsible_if`. Some ended up looking worse afterwards, though, so I left those out. Also applies instances of `clippy::collapsible_else_if`

Review with whitespace disabled please.
This commit is contained in:
Stuart Cook 2024-09-12 20:37:16 +10:00 committed by GitHub
commit 3ba12756d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
61 changed files with 563 additions and 671 deletions

View file

@ -429,10 +429,8 @@ impl MissingDoc {
// Only check publicly-visible items, using the result from the privacy pass.
// It's an option so the crate root can also use this function (it doesn't
// have a `NodeId`).
if def_id != CRATE_DEF_ID {
if !cx.effective_visibilities.is_exported(def_id) {
return;
}
if def_id != CRATE_DEF_ID && !cx.effective_visibilities.is_exported(def_id) {
return;
}
let attrs = cx.tcx.hir().attrs(cx.tcx.local_def_id_to_hir_id(def_id));