Skip to content

Commit 176c34a

Browse files
committed
Invert the sense of is_not_macro_export.
I find it much easier to think about in the positive sense.
1 parent bb063e6 commit 176c34a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/tools/clippy/clippy_lints/src/redundant_pub_crate.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl<'tcx> LateLintPass<'tcx> for RedundantPubCrate {
4949
if cx.tcx.visibility(item.owner_id.def_id) == ty::Visibility::Restricted(CRATE_DEF_ID.to_def_id())
5050
&& !cx.effective_visibilities.is_exported(item.owner_id.def_id)
5151
&& self.is_exported.last() == Some(&false)
52-
&& is_not_macro_export(item)
52+
&& !is_macro_export(item)
5353
&& !item.span.in_external_macro(cx.sess().source_map())
5454
{
5555
let span = item
@@ -86,18 +86,18 @@ impl<'tcx> LateLintPass<'tcx> for RedundantPubCrate {
8686
}
8787
}
8888

89-
fn is_not_macro_export<'tcx>(item: &'tcx Item<'tcx>) -> bool {
89+
fn is_macro_export<'tcx>(item: &'tcx Item<'tcx>) -> bool {
9090
if let ItemKind::Use(path, _) = item.kind {
9191
if path
9292
.res
9393
.iter()
9494
.all(|res| matches!(res, Res::Def(DefKind::Macro(MacroKind::Bang), _)))
9595
{
96-
return false;
96+
return true;
9797
}
9898
} else if let ItemKind::Macro(..) = item.kind {
99-
return false;
99+
return true;
100100
}
101101

102-
true
102+
false
103103
}

0 commit comments

Comments
 (0)