From 4d2fc8c1fb2f4d75a7f8722900461edb3703cdc8 Mon Sep 17 00:00:00 2001 From: Diana <5275194+DianaNites@users.noreply.github.com> Date: Sun, 18 Sep 2022 08:55:17 -0700 Subject: [PATCH] Keep hwmon sensor name for non-GPUs too --- src/app/data_harvester/temperature/linux.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/data_harvester/temperature/linux.rs b/src/app/data_harvester/temperature/linux.rs index 9d4ed73bb..4348b9cfd 100644 --- a/src/app/data_harvester/temperature/linux.rs +++ b/src/app/data_harvester/temperature/linux.rs @@ -139,10 +139,12 @@ fn get_from_hwmon( .map(|f| f.to_str().unwrap_or_default().to_owned()) .unwrap(); if link.as_bytes()[0].is_ascii_alphabetic() { - Some(link) + if let Some(hwmon_name) = hwmon_name.as_ref() { + Some(format!("{} ({})", link, hwmon_name.trim())) + } else { + Some(link) + } } else { - // No idea why rust thinks this may have been moved - // in a previous loop iteration and needs a clone hwmon_name.clone() } }