Strongly type the Led brightness

This commit is contained in:
Luke D Jones
2021-03-22 14:09:27 +13:00
parent 7a51cd1c70
commit 03b338bdfa
6 changed files with 70 additions and 28 deletions
+3 -3
View File
@@ -7,14 +7,14 @@ use std::str::FromStr;
#[derive(Options)]
pub struct LedBrightness {
level: Option<u8>,
level: Option<u32>,
}
impl LedBrightness {
pub fn new(level: Option<u8>) -> Self {
pub fn new(level: Option<u32>) -> Self {
LedBrightness { level }
}
pub fn level(&self) -> Option<u8> {
pub fn level(&self) -> Option<u32> {
self.level
}
}