@@ -856,7 +856,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
856856 . tables
857857 . children
858858 . get ( self , index)
859- . unwrap_or ( Lazy :: empty ( ) )
859+ . unwrap_or_else ( Lazy :: empty)
860860 . decode ( self )
861861 . map ( |index| ty:: FieldDef {
862862 did : self . local_def_id ( index) ,
@@ -888,7 +888,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
888888 . tables
889889 . children
890890 . get ( self , item_id)
891- . unwrap_or ( Lazy :: empty ( ) )
891+ . unwrap_or_else ( Lazy :: empty)
892892 . decode ( self )
893893 . map ( |index| self . get_variant ( & self . kind ( index) , index, did, tcx. sess ) )
894894 . collect ( )
@@ -1075,7 +1075,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
10751075
10761076 // Iterate over all children.
10771077 let macros_only = self . dep_kind . lock ( ) . macros_only ( ) ;
1078- let children = self . root . tables . children . get ( self , id) . unwrap_or ( Lazy :: empty ( ) ) ;
1078+ let children = self . root . tables . children . get ( self , id) . unwrap_or_else ( Lazy :: empty) ;
10791079 for child_index in children. decode ( ( self , sess) ) {
10801080 if macros_only {
10811081 continue ;
@@ -1098,7 +1098,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
10981098 . tables
10991099 . children
11001100 . get ( self , child_index)
1101- . unwrap_or ( Lazy :: empty ( ) ) ;
1101+ . unwrap_or_else ( Lazy :: empty) ;
11021102 for child_index in child_children. decode ( ( self , sess) ) {
11031103 let kind = self . def_kind ( child_index) ;
11041104 callback ( Export {
@@ -1284,7 +1284,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
12841284 }
12851285
12861286 fn get_item_variances ( & self , id : DefIndex ) -> Vec < ty:: Variance > {
1287- self . root . tables . variances . get ( self , id) . unwrap_or ( Lazy :: empty ( ) ) . decode ( self ) . collect ( )
1287+ self . root . tables . variances . get ( self , id) . unwrap_or_else ( Lazy :: empty) . decode ( self ) . collect ( )
12881288 }
12891289
12901290 fn get_ctor_kind ( & self , node_id : DefIndex ) -> CtorKind {
@@ -1323,7 +1323,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
13231323 . tables
13241324 . attributes
13251325 . get ( self , item_id)
1326- . unwrap_or ( Lazy :: empty ( ) )
1326+ . unwrap_or_else ( Lazy :: empty)
13271327 . decode ( ( self , sess) )
13281328 . collect :: < Vec < _ > > ( )
13291329 }
@@ -1333,7 +1333,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
13331333 . tables
13341334 . children
13351335 . get ( self , id)
1336- . unwrap_or ( Lazy :: empty ( ) )
1336+ . unwrap_or_else ( Lazy :: empty)
13371337 . decode ( self )
13381338 . map ( |index| respan ( self . get_span ( index, sess) , self . item_ident ( index, sess) . name ) )
13391339 . collect ( )
@@ -1349,7 +1349,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
13491349 . tables
13501350 . inherent_impls
13511351 . get ( self , id)
1352- . unwrap_or ( Lazy :: empty ( ) )
1352+ . unwrap_or_else ( Lazy :: empty)
13531353 . decode ( self )
13541354 . map ( |index| self . local_def_id ( index) ) ,
13551355 )
0 commit comments