moving imports trough die gegend
This commit is contained in:
@@ -6,7 +6,7 @@ use nvml_wrapper::Nvml;
|
|||||||
use reqwest::{Client, StatusCode};
|
use reqwest::{Client, StatusCode};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::{error::Error, fs, process::Command, time::Duration};
|
use std::{error::Error, fs, process::Command, time::Duration};
|
||||||
use sysinfo::{Components, Disks, System};
|
use sysinfo::{Disks, System};
|
||||||
use tokio::time::{interval, sleep, Instant};
|
use tokio::time::{interval, sleep, Instant};
|
||||||
|
|
||||||
// Windows specific imports
|
// Windows specific imports
|
||||||
@@ -422,6 +422,7 @@ fn get_cpu_temp() -> Option<f32> {
|
|||||||
println!("Attempting to get CPU temperature...");
|
println!("Attempting to get CPU temperature...");
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
{
|
{
|
||||||
|
use sysinfo::Components;
|
||||||
println!("Attempting to get CPU temperature on Linux...");
|
println!("Attempting to get CPU temperature on Linux...");
|
||||||
let mut sys = System::new_all();
|
let mut sys = System::new_all();
|
||||||
//let components = Components::new_with_refreshed_list();
|
//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")]
|
#[cfg(target_os = "windows")]
|
||||||
use systemstat::{Platform, System as SysStat};
|
|
||||||
{
|
{
|
||||||
|
use systemstat::{Platform, System as SysStat};
|
||||||
let sys = SysStat::new();
|
let sys = SysStat::new();
|
||||||
|
|
||||||
match sys.cpu_temp() {
|
match sys.cpu_temp() {
|
||||||
Ok(temp) => return Some(temp),
|
Ok(temp) => return Some(temp),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
@@ -459,8 +459,6 @@ fn get_cpu_temp() -> Option<f32> {
|
|||||||
println!("CPU temperature retrieval not supported on this OS.");
|
println!("CPU temperature retrieval not supported on this OS.");
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
None
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user