Fix thread 'main' panicked at asusctl/src/main.rs:85:14:

This commit is contained in:
guylamar2006
2025-02-17 21:13:42 +00:00
committed by Luke Jones
parent ae8ce83583
commit 3e4d594b05

View File

@@ -74,22 +74,36 @@ fn main() {
println!("\nError: {e}\n");
print_info();
}) {
let asusd_version = platform_proxy
.version()
.map_err(|e| {
let asusd_version = match platform_proxy.version() {
Ok(version) => version,
Err(e) => {
error!(
"Could not get asusd version: {e:?}\nIs asusd.service running? {}",
check_service("asusd")
);
})
.unwrap();
return;
}
};
if asusd_version != self_version {
println!("Version mismatch: asusctl = {self_version}, asusd = {asusd_version}");
return;
}
let supported_properties = platform_proxy.supported_properties().unwrap();
let supported_interfaces = list_iface_blocking().unwrap();
let supported_properties = match platform_proxy.supported_properties() {
Ok(props) => props,
Err(e) => {
error!("Could not get supported properties: {e:?}");
return;
}
};
let supported_interfaces = match list_iface_blocking() {
Ok(ifaces) => ifaces,
Err(e) => {
error!("Could not get supported interfaces: {e:?}");
return;
}
};
if parsed.version {
println!("asusctl v{}", env!("CARGO_PKG_VERSION"));