Update src/uu/lscpu/src/sysfs.rs
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
This commit is contained in:

committed by
alxndrv

parent
3180b89522
commit
748bbf845e
@ -184,10 +184,9 @@ fn read_cpu_caches(cpu_index: usize) -> Vec<CpuCache> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn read_freq_boost_state() -> Option<bool> {
|
pub fn read_freq_boost_state() -> Option<bool> {
|
||||||
match fs::read_to_string("/sys/devices/system/cpu/cpufreq/boost") {
|
fs::read_to_string("/sys/devices/system/cpu/cpufreq/boost")
|
||||||
Ok(content) => Some(content.trim() == "1"),
|
.map(|content| content.trim() == "1")
|
||||||
Err(_) => None,
|
.ok()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn read_cpu_vulnerabilities() -> Vec<CpuVulnerability> {
|
pub fn read_cpu_vulnerabilities() -> Vec<CpuVulnerability> {
|
||||||
|
Reference in New Issue
Block a user