diff --git a/core/startos/src/util/cpupower.rs b/core/startos/src/util/cpupower.rs index 7fa850a88..cc4ac5ef4 100644 --- a/core/startos/src/util/cpupower.rs +++ b/core/startos/src/util/cpupower.rs @@ -39,13 +39,12 @@ impl std::borrow::Borrow for Governor { } pub async fn get_available_governors() -> Result, Error> { - let raw = String::from_utf8( - Command::new("cpupower") - .arg("frequency-info") - .arg("-g") - .invoke(ErrorKind::CpuSettings) - .await?, - )?; + let raw = Command::new("cpupower") + .arg("frequency-info") + .arg("-g") + .invoke(ErrorKind::CpuSettings) + .await + .map_or_else(|e| Ok(e.source.to_string()), String::from_utf8)?; let mut for_cpu: OrdMap> = OrdMap::new(); let mut current_cpu = None; for line in raw.lines() {