File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -91,10 +91,11 @@ impl RecentlyAccessedReleases {
9191 }
9292
9393 pub ( crate ) fn record ( & self , krate : i32 , version : i32 , target : & str ) {
94- self . crates . insert ( krate, Instant :: now ( ) ) ;
95- self . versions . insert ( version, Instant :: now ( ) ) ;
94+ let now = Instant :: now ( ) ;
95+ self . crates . insert ( krate, now) ;
96+ self . versions . insert ( version, now) ;
9697 self . platforms
97- . insert ( ( version, TargetAtom :: from ( target) ) , Instant :: now ( ) ) ;
98+ . insert ( ( version, TargetAtom :: from ( target) ) , now) ;
9899 }
99100
100101 pub ( crate ) fn gather ( & self , metrics : & Metrics ) {
@@ -116,7 +117,7 @@ impl RecentlyAccessedReleases {
116117 }
117118
118119 // Only retain items accessed within the last hour
119- return elapsed < Duration :: from_secs ( 60 * 60 ) ;
120+ elapsed < Duration :: from_secs ( 60 * 60 )
120121 } ) ;
121122
122123 metric. with_label_values ( & [ "one hour" ] ) . set ( hour_count) ;
You can’t perform that action at this time.
0 commit comments