Skip to content

Commit

Permalink
Keep hwmon sensor name for non-GPUs too
Browse files Browse the repository at this point in the history
  • Loading branch information
DianaNites committed Oct 31, 2022
1 parent f2943e7 commit 4d2fc8c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/app/data_harvester/temperature/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand Down

0 comments on commit 4d2fc8c

Please sign in to comment.