moving imports trough die gegend

This commit is contained in:
2025-08-01 23:03:31 +02:00
parent e0d366b720
commit 2514275bf8

View File

@@ -6,7 +6,7 @@ use nvml_wrapper::Nvml;
use reqwest::{Client, StatusCode};
use serde::{Deserialize, Serialize};
use std::{error::Error, fs, process::Command, time::Duration};
use sysinfo::{Components, Disks, System};
use sysinfo::{Disks, System};
use tokio::time::{interval, sleep, Instant};
// Windows specific imports
@@ -422,6 +422,7 @@ fn get_cpu_temp() -> Option<f32> {
println!("Attempting to get CPU temperature...");
#[cfg(target_os = "linux")]
{
use sysinfo::Components;
println!("Attempting to get CPU temperature on Linux...");
let mut sys = System::new_all();
//let components = Components::new_with_refreshed_list();
@@ -436,14 +437,13 @@ fn get_cpu_temp() -> Option<f32> {
}
}
Some(0.0)
None
}
#[cfg(target_os = "windows")]
use systemstat::{Platform, System as SysStat};
{
use systemstat::{Platform, System as SysStat};
let sys = SysStat::new();
match sys.cpu_temp() {
Ok(temp) => return Some(temp),
Err(e) => {
@@ -459,8 +459,6 @@ fn get_cpu_temp() -> Option<f32> {
println!("CPU temperature retrieval not supported on this OS.");
None
}
None
}
/*