diff options
| author | 2025-02-15 14:15:43 +0100 | |
|---|---|---|
| committer | 2025-02-15 14:15:43 +0100 | |
| commit | d6848977bcad767a8e8ae83b5069726615886947 (patch) | |
| tree | cb4a1995385d36faa5ad1d5b40bbff7875b7523d /winit/src | |
| parent | 7c54bdef1062e4008582d8b1e215ffcc1c1ee016 (diff) | |
| parent | 8694eeb5c5ace4c2343e1eec3e64e27d36b656bd (diff) | |
| download | iced-d6848977bcad767a8e8ae83b5069726615886947.tar.gz iced-d6848977bcad767a8e8ae83b5069726615886947.tar.bz2 iced-d6848977bcad767a8e8ae83b5069726615886947.zip | |
Merge pull request #2797 from AMS21/fix_2794
Fix system informations `cpu_brand` always being empty
Diffstat (limited to '')
| -rw-r--r-- | winit/src/system.rs | 8 | 
1 files changed, 6 insertions, 2 deletions
| diff --git a/winit/src/system.rs b/winit/src/system.rs index 361135be..0b476773 100644 --- a/winit/src/system.rs +++ b/winit/src/system.rs @@ -17,7 +17,11 @@ pub(crate) fn information(      let mut system = System::new_all();      system.refresh_all(); -    let cpu = system.global_cpu_info(); +    let cpu_brand = system +        .cpus() +        .first() +        .map(|cpu| cpu.brand().to_string()) +        .unwrap_or_default();      let memory_used = sysinfo::get_current_pid()          .and_then(|pid| system.process(pid).ok_or("Process not found")) @@ -29,7 +33,7 @@ pub(crate) fn information(          system_kernel: System::kernel_version(),          system_version: System::long_os_version(),          system_short_version: System::os_version(), -        cpu_brand: cpu.brand().into(), +        cpu_brand,          cpu_cores: system.physical_core_count(),          memory_total: system.total_memory(),          memory_used, | 
