Skip to content

Commit 050deb5

Browse files
committed
Review nits
1 parent 9a7482e commit 050deb5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/metrics/mod.rs

+5-4
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)