mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-13 01:41:59 -04:00
Fix enum errors containing {v} instead of value
This commit is contained in:
parent
0871125e3e
commit
674c693180
3 changed files with 12 additions and 12 deletions
|
@ -52,7 +52,7 @@ impl FromStr for HardwareVariant {
|
|||
}
|
||||
|
||||
impl TryFrom<u32> for HardwareCurrentlySupported {
|
||||
type Error = &'static str;
|
||||
type Error = String;
|
||||
fn try_from(v: u32) -> Result<Self, Self::Error> {
|
||||
match v {
|
||||
x if x == HardwareCurrentlySupported::Unknown as u32 => {
|
||||
|
@ -64,7 +64,7 @@ impl TryFrom<u32> for HardwareCurrentlySupported {
|
|||
x if x == HardwareCurrentlySupported::Supported as u32 => {
|
||||
Ok(HardwareCurrentlySupported::Supported)
|
||||
}
|
||||
_ => Err("No enum match for value {v}"),
|
||||
_ => Err(format!("No enum match for value {v}")),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -80,12 +80,12 @@ impl fmt::Display for HardwareCurrentlySupported {
|
|||
}
|
||||
|
||||
impl TryFrom<u32> for FanControlState {
|
||||
type Error = &'static str;
|
||||
type Error = String;
|
||||
fn try_from(v: u32) -> Result<Self, Self::Error> {
|
||||
match v {
|
||||
x if x == FanControlState::Bios as u32 => Ok(FanControlState::Bios),
|
||||
x if x == FanControlState::Os as u32 => Ok(FanControlState::Os),
|
||||
_ => Err("No enum match for value {v}"),
|
||||
_ => Err(format!("No enum match for value {v}")),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue