hardware: Fix style

This commit is contained in:
Vicki Pfau 2024-03-28 18:52:24 -07:00
parent 8ae6c98554
commit aaaf8b8bc4

View file

@ -80,6 +80,17 @@ pub async fn variant() -> Result<HardwareVariant> {
HardwareVariant::from_str(board_name.trim_end()) HardwareVariant::from_str(board_name.trim_end())
} }
pub async fn check_support() -> Result<HardwareCurrentlySupported> {
// 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)] #[cfg(test)]
mod test { mod test {
use super::*; use super::*;
@ -119,14 +130,3 @@ mod test {
assert_eq!(variant().await.unwrap(), HardwareVariant::Unknown); assert_eq!(variant().await.unwrap(), HardwareVariant::Unknown);
} }
} }
pub async fn check_support() -> Result<HardwareCurrentlySupported> {
// 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,
})
}