Fix after upgrading sysinfo

This commit is contained in:
Clément Renault 2025-01-08 15:59:30 +01:00
parent 5e8144b0e1
commit d4529d8c83
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F
2 changed files with 4 additions and 7 deletions

View File

@ -760,8 +760,8 @@ impl MaxMemory {
/// Returns the total amount of bytes available or `None` if this system isn't supported. /// Returns the total amount of bytes available or `None` if this system isn't supported.
fn total_memory_bytes() -> Option<u64> { fn total_memory_bytes() -> Option<u64> {
if sysinfo::IS_SUPPORTED_SYSTEM { if sysinfo::IS_SUPPORTED_SYSTEM {
let memory_kind = RefreshKind::new().with_memory(MemoryRefreshKind::new().with_ram()); let mem_kind = RefreshKind::nothing().with_memory(MemoryRefreshKind::nothing().with_ram());
let mut system = System::new_with_specifics(memory_kind); let mut system = System::new_with_specifics(mem_kind);
system.refresh_memory(); system.refresh_memory();
Some(system.total_memory()) Some(system.total_memory())
} else { } else {

View File

@ -27,8 +27,7 @@ impl Environment {
let unknown_string = String::from("Unknown"); let unknown_string = String::from("Unknown");
let mut system = System::new(); let mut system = System::new();
system.refresh_cpu(); system.refresh_cpu_all();
system.refresh_cpu_frequency();
system.refresh_memory(); system.refresh_memory();
let (cpu, frequency) = match system.cpus().first() { let (cpu, frequency) = match system.cpus().first() {
@ -50,9 +49,7 @@ impl Environment {
if let Some(os) = System::os_version() { if let Some(os) = System::os_version() {
software.push(VersionInfo { name: os, version: String::from("kernel-release") }); software.push(VersionInfo { name: os, version: String::from("kernel-release") });
} }
if let Some(arch) = System::cpu_arch() { software.push(VersionInfo { name: System::cpu_arch(), version: String::from("arch") });
software.push(VersionInfo { name: arch, version: String::from("arch") });
}
Self { Self {
hostname: System::host_name(), hostname: System::host_name(),