diff --git a/src/cpu.rs b/src/cpu.rs index ae45ffb..e97d9e1 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -264,13 +264,9 @@ pub fn get_platform_profiles() -> Result> { ))); } - let buf = fs::read(path) + let content = fs::read_to_string(path) .map_err(|_| ControlError::PermissionDenied(format!("Cannot read contents of {path}.")))?; - let content = str::from_utf8(&buf).map_err(|_| { - ControlError::NotSupported(format!("No platform profile choices found at {path}.")) - })?; - Ok(content .split_whitespace() .map(ToString::to_string)