src/exporter: clippy

This commit is contained in:
Max Inden 2020-04-13 18:08:07 +02:00
parent 2dc98bec36
commit e343a11bd7
No known key found for this signature in database
GPG Key ID: 5403C5464810BC26
2 changed files with 3 additions and 3 deletions

View File

@ -252,7 +252,7 @@ impl Future for Exporter {
if let Poll::Ready(()) = this.tick.poll_unpin(ctx) {
this.tick = Delay::new(TICK_INTERVAL);
for (_, node_store) in &mut this.node_stores {
for node_store in &mut this.node_stores.values() {
node_store.update_metrics();
}

View File

@ -42,12 +42,12 @@ impl NodeStore {
nodes_by_time_by_country.insert(Duration::from_secs(60 * 60 * *factor), HashMap::new());
}
for (_peer_id, node) in &self.nodes {
for node in self.nodes.values() {
let since_last_seen = now - node.last_seen;
for (time_barrier, countries) in &mut nodes_by_time_by_country {
if since_last_seen < *time_barrier {
countries
.entry(node.country.clone().unwrap_or("unknown".to_string()))
.entry(node.country.clone().unwrap_or_else(|| "unknown".to_string()))
.and_modify(|v| *v += 1)
.or_insert(1);
}