From aaaf8b8bc484de094e1379adca5acca88aa0b341 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 28 Mar 2024 18:52:24 -0700 Subject: [PATCH] hardware: Fix style --- src/hardware.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/hardware.rs b/src/hardware.rs index fc1ef1f..9c45871 100644 --- a/src/hardware.rs +++ b/src/hardware.rs @@ -80,6 +80,17 @@ pub async fn variant() -> Result { HardwareVariant::from_str(board_name.trim_end()) } +pub async fn check_support() -> Result { + // Run jupiter-check-support note this script does exit 1 for "Support: No" case + // so no need to parse output, etc. + let res = script_exit_code("/usr/bin/jupiter-check-support", &[] as &[String; 0]).await?; + + Ok(match res { + 0 => HardwareCurrentlySupported::Supported, + _ => HardwareCurrentlySupported::Unsupported, + }) +} + #[cfg(test)] mod test { use super::*; @@ -119,14 +130,3 @@ mod test { assert_eq!(variant().await.unwrap(), HardwareVariant::Unknown); } } - -pub async fn check_support() -> Result { - // Run jupiter-check-support note this script does exit 1 for "Support: No" case - // so no need to parse output, etc. - let res = script_exit_code("/usr/bin/jupiter-check-support", &[] as &[String; 0]).await?; - - Ok(match res { - 0 => HardwareCurrentlySupported::Supported, - _ => HardwareCurrentlySupported::Unsupported, - }) -}