From 108aaac609264787f847c8d98ed7917d37576fd4 Mon Sep 17 00:00:00 2001 From: Benoit Petit Date: Tue, 22 Dec 2020 13:53:24 +0100 Subject: [PATCH] style: cargo fmt --- src/exporters/prometheus.rs | 5 +++-- src/sensors/utils.rs | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/exporters/prometheus.rs b/src/exporters/prometheus.rs index 191ae25a..bd84e8b7 100644 --- a/src/exporters/prometheus.rs +++ b/src/exporters/prometheus.rs @@ -195,7 +195,7 @@ async fn show_metrics(data: web::Data) -> impl Responder { String::from(metric_name), format_metric(metric_name, &metric_value.to_string(), None), ); - } + } let metric_gathering = procfs::process::Process::myself().unwrap().statm(); if let Ok(metric_value) = metric_gathering { @@ -270,7 +270,8 @@ async fn show_metrics(data: web::Data) -> impl Responder { body, String::from("Number of energy consumption Records stored for each socket"), String::from("gauge"), - String::from(metric_name), format_metric( + String::from(metric_name), + format_metric( metric_name, &s.record_buffer.len().to_string(), Some(&labels), diff --git a/src/sensors/utils.rs b/src/sensors/utils.rs index e493ea0f..4b8c1e4b 100644 --- a/src/sensors/utils.rs +++ b/src/sensors/utils.rs @@ -290,9 +290,9 @@ impl ProcessTracker { fn drop_empty_process_records_vectors(&mut self) { let procs = &mut self.procs; if !procs.is_empty() { - for i in 0..(procs.len()-1) { - if let Some(v) = procs.get(i) { - if v.is_empty() { + for i in 0..(procs.len() - 1) { + if let Some(v) = procs.get(i) { + if v.is_empty() { procs.remove(i); } }