Changes after my own PR review

This commit is contained in:
jochen@g14
2024-03-30 23:23:37 +01:00
parent fde2f3ba15
commit 0674e7f61c
11 changed files with 268 additions and 592 deletions

View File

@@ -88,15 +88,15 @@ impl FromStr for LedBrightness {
}
}
}
impl Display for LedBrightness {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
impl ToString for LedBrightness {
fn to_string(&self) -> String {
let s = match self.level {
Some(0x00) => "low",
Some(0x01) => "med",
Some(0x02) => "high",
_ => "unknown",
};
write!(f, "{}", s.to_owned())
s.to_owned()
}
}