From e6015cf0f16921c081ba8bdb7423c7c4a7f6b322 Mon Sep 17 00:00:00 2001 From: Bloxx12 Date: Tue, 13 May 2025 19:59:06 +0200 Subject: [PATCH] cpu: cleanup get_platform_profiles --- src/cpu.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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)