Merge pull request #2797 from AMS21/fix_2794

Fix system informations `cpu_brand` always being empty
This commit is contained in:
Héctor 2025-02-15 14:15:43 +01:00 committed by GitHub
commit d6848977bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 204 additions and 116 deletions

View file

@ -102,22 +102,22 @@ impl Example {
);
let memory_readable =
ByteSize::b(information.memory_total).to_string();
ByteSize::b(information.memory_total).to_string_as(true);
let memory_total = text!(
"Memory (total): {} bytes ({memory_readable})",
information.memory_total,
);
let memory_text = if let Some(memory_used) =
information.memory_used
{
let memory_readable = ByteSize::b(memory_used).to_string();
let memory_text =
if let Some(memory_used) = information.memory_used {
let memory_readable =
ByteSize::b(memory_used).to_string_as(true);
format!("{memory_used} bytes ({memory_readable})")
} else {
String::from("None")
};
format!("{memory_used} bytes ({memory_readable})")
} else {
String::from("None")
};
let memory_used = text!("Memory (used): {memory_text}");