satisfied cargo clippy
This commit is contained in:
@@ -5,7 +5,7 @@ use crate::models::{HeartbeatDto, IdResponse, MetricDto, RegistrationDto};
|
||||
use anyhow::Result;
|
||||
use reqwest::{Client, StatusCode};
|
||||
use std::error::Error;
|
||||
use tokio::time::{interval, sleep};
|
||||
use tokio::time::sleep;
|
||||
|
||||
pub async fn register_with_server(
|
||||
base_url: &str,
|
||||
|
@@ -21,7 +21,7 @@ pub struct HardwareInfo {
|
||||
pub memory: memory::MemoryInfo,
|
||||
pub disk: disk::DiskInfo,
|
||||
pub network: network::NetworkInfo,
|
||||
network_monitor: network::NetworkMonitor,
|
||||
pub network_monitor: network::NetworkMonitor,
|
||||
}
|
||||
|
||||
impl HardwareInfo {
|
||||
|
@@ -16,6 +16,12 @@ pub struct NetworkMonitor {
|
||||
last_update: Instant,
|
||||
}
|
||||
|
||||
impl Default for NetworkMonitor {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl NetworkMonitor {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
|
@@ -32,7 +32,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||
Ok((id, ip)) => (id, ip),
|
||||
Err(e) => {
|
||||
eprintln!("Fehler bei der Registrierung am Server: {e}");
|
||||
return Err(e.into());
|
||||
return Err(e);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -59,12 +59,11 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||
let (heartbeat_handle, metrics_handle) =
|
||||
tokio::try_join!(flatten(heartbeat_handle), flatten(metrics_handle))?;
|
||||
|
||||
match (heartbeat_handle, metrics_handle) {
|
||||
(heartbeat, metrics) => println!(
|
||||
"All tasks completed successfully: {:?}, {:?}.",
|
||||
heartbeat, metrics
|
||||
),
|
||||
}
|
||||
let (heartbeat, metrics) = (heartbeat_handle, metrics_handle);
|
||||
println!(
|
||||
"All tasks completed successfully: {:?}, {:?}.",
|
||||
heartbeat, metrics
|
||||
);
|
||||
|
||||
println!("All tasks completed successfully.");
|
||||
|
||||
|
@@ -45,7 +45,7 @@ impl Collector {
|
||||
Ok(hw) => hw,
|
||||
Err(e) => {
|
||||
eprintln!("Fehler beim Sammeln der Hardware-Infos: {e}");
|
||||
return Err(e.into());
|
||||
return Err(e);
|
||||
}
|
||||
};
|
||||
// Collect network usage
|
||||
|
Reference in New Issue
Block a user