mirror of
https://github.com/fluencelabs/kademlia-exporter
synced 2025-04-24 13:52:13 +00:00
src/exporter: clippy
This commit is contained in:
parent
2dc98bec36
commit
e343a11bd7
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user