Add git hooks via cargo-husky. Many many cleanups.

This commit is contained in:
Luke D. Jones
2023-01-16 12:03:52 +13:00
parent b5b7799018
commit a83ccbd33d
49 changed files with 252 additions and 250 deletions

View File

@@ -44,4 +44,7 @@ sysfs-class.workspace = true # used for backlight control and baord ID
concat-idents.workspace = true
systemd-zbus = "*"
systemd-zbus = "*"
[dev-dependencies]
cargo-husky.workspace = true

View File

@@ -29,7 +29,7 @@ impl StdConfig for Config {
}
fn file_name(&self) -> String {
CONFIG_FILE.to_string()
CONFIG_FILE.to_owned()
}
}

View File

@@ -145,7 +145,7 @@ impl StdConfig for AnimeConfig {
}
fn file_name(&self) -> String {
CONFIG_FILE.to_string()
CONFIG_FILE.to_owned()
}
}

View File

@@ -195,7 +195,7 @@ impl StdConfig for AuraConfig {
}
fn file_name(&self) -> String {
CONFIG_FILE.to_string()
CONFIG_FILE.to_owned()
}
}

View File

@@ -1,4 +1,4 @@
pub mod config;
pub mod controller;
/// Implements CtrlTask, Reloadable, ZbusRun
/// Implements `CtrlTask`, `Reloadable`, `ZbusRun`
pub mod trait_impls;

View File

@@ -92,15 +92,8 @@ impl CtrlPlatform {
}
pub fn get_boot_sound() -> Result<i8, RogError> {
let path = ASUS_POST_LOGO_SOUND;
let mut file = OpenOptions::new()
.read(true)
.open(path)
.map_err(|err| RogError::Path(path.into(), err))?;
let mut data = Vec::new();
file.read_to_end(&mut data)
.map_err(|err| RogError::Read(path.into(), err))?;
let data = std::fs::read(ASUS_POST_LOGO_SOUND)
.map_err(|err| RogError::Read(ASUS_POST_LOGO_SOUND.into(), err))?;
let idx = data.len() - 1;
Ok(data[idx] as i8)
@@ -115,6 +108,7 @@ impl CtrlPlatform {
.map_err(|err| RogError::Path(path.into(), err))?;
let mut data = Vec::new();
#[allow(clippy::verbose_file_reads)]
file.read_to_end(&mut data)
.map_err(|err| RogError::Read(path.into(), err))?;

View File

@@ -28,7 +28,7 @@ impl StdConfig for ProfileConfig {
}
fn file_name(&self) -> String {
CONFIG_FILE.to_string()
CONFIG_FILE.to_owned()
}
}
@@ -77,7 +77,7 @@ impl StdConfig for FanCurveConfig {
}
fn file_name(&self) -> String {
CONFIG_FAN_FILE.to_string()
CONFIG_FAN_FILE.to_owned()
}
}