@@ -543,7 +543,7 @@ impl EmbargoVisitor<'tcx> {
543543 module : LocalDefId ,
544544 ) {
545545 let level = Some ( AccessLevel :: Reachable ) ;
546- if let ty :: Visibility :: Public = vis {
546+ if vis. is_public ( ) {
547547 self . update ( def_id, level) ;
548548 }
549549 match def_kind {
@@ -580,7 +580,7 @@ impl EmbargoVisitor<'tcx> {
580580
581581 DefKind :: Struct | DefKind :: Union => {
582582 // While structs and unions have type privacy, their fields do not.
583- if let ty :: Visibility :: Public = vis {
583+ if vis. is_public ( ) {
584584 let item =
585585 self . tcx . hir ( ) . expect_item ( self . tcx . hir ( ) . local_def_id_to_hir_id ( def_id) ) ;
586586 if let hir:: ItemKind :: Struct ( ref struct_def, _)
@@ -933,7 +933,7 @@ impl Visitor<'tcx> for EmbargoVisitor<'tcx> {
933933 let def_id = self . tcx . hir ( ) . local_def_id ( id) ;
934934 if let Some ( exports) = self . tcx . module_exports ( def_id) {
935935 for export in exports. iter ( ) {
936- if export. vis == ty :: Visibility :: Public {
936+ if export. vis . is_public ( ) {
937937 if let Some ( def_id) = export. res . opt_def_id ( ) {
938938 if let Some ( def_id) = def_id. as_local ( ) {
939939 self . update ( def_id, Some ( AccessLevel :: Exported ) ) ;
@@ -1918,8 +1918,7 @@ impl SearchInterfaceForPrivateItemsVisitor<'tcx> {
19181918 /// 1. It's contained within a public type
19191919 /// 2. It comes from a private crate
19201920 fn leaks_private_dep ( & self , item_id : DefId ) -> bool {
1921- let ret = self . required_visibility == ty:: Visibility :: Public
1922- && self . tcx . is_private_dep ( item_id. krate ) ;
1921+ let ret = self . required_visibility . is_public ( ) && self . tcx . is_private_dep ( item_id. krate ) ;
19231922
19241923 tracing:: debug!( "leaks_private_dep(item_id={:?})={}" , item_id, ret) ;
19251924 ret
0 commit comments