global_cpu_info().name() returns 0 on M2 Pro #1261
-
Hi there, I'm not sure if I'm missing something but with the following code: /// Get the CPU name.
///
/// # Examples
/// M1 Pro, Intel Core i9-9900K, etc.
pub fn get_cpu_name() -> String {
let sys = System::new_with_specifics(RefreshKind::new().with_cpu(CpuRefreshKind::everything()));
sys.global_cpu_info().name().to_string()
} I get Apologies if this is a stupid question, since I'm quite new to the language. |
Beta Was this translation helpful? Give feedback.
Answered by
GuillaumeGomez
Apr 28, 2024
Replies: 1 comment
-
You can see the code here. I wonder if the name shouldn't be empty instead... In any case, the |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
net-tech
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can see the code here.
I wonder if the name shouldn't be empty instead... In any case, the
global_cpu
is not supposed to have a name as a computer can have multiple CPUs from different brands at the same time.