1
Fork 0
mirror of https://github.com/RGBCube/superfreq synced 2025-07-27 17:07:44 +00:00

cpu: cleanup get_platform_profiles

This commit is contained in:
Bloxx12 2025-05-13 19:59:06 +02:00
parent 25db531651
commit e6015cf0f1
No known key found for this signature in database

View file

@ -264,13 +264,9 @@ pub fn get_platform_profiles() -> Result<Vec<String>> {
)));
}
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)