mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Fix thread 'main' panicked at asusctl/src/main.rs:85:14:
This commit is contained in:
@@ -74,22 +74,36 @@ fn main() {
|
|||||||
println!("\nError: {e}\n");
|
println!("\nError: {e}\n");
|
||||||
print_info();
|
print_info();
|
||||||
}) {
|
}) {
|
||||||
let asusd_version = platform_proxy
|
let asusd_version = match platform_proxy.version() {
|
||||||
.version()
|
Ok(version) => version,
|
||||||
.map_err(|e| {
|
Err(e) => {
|
||||||
error!(
|
error!(
|
||||||
"Could not get asusd version: {e:?}\nIs asusd.service running? {}",
|
"Could not get asusd version: {e:?}\nIs asusd.service running? {}",
|
||||||
check_service("asusd")
|
check_service("asusd")
|
||||||
);
|
);
|
||||||
})
|
return;
|
||||||
.unwrap();
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if asusd_version != self_version {
|
if asusd_version != self_version {
|
||||||
println!("Version mismatch: asusctl = {self_version}, asusd = {asusd_version}");
|
println!("Version mismatch: asusctl = {self_version}, asusd = {asusd_version}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let supported_properties = platform_proxy.supported_properties().unwrap();
|
let supported_properties = match platform_proxy.supported_properties() {
|
||||||
let supported_interfaces = list_iface_blocking().unwrap();
|
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 {
|
if parsed.version {
|
||||||
println!("asusctl v{}", env!("CARGO_PKG_VERSION"));
|
println!("asusctl v{}", env!("CARGO_PKG_VERSION"));
|
||||||
|
|||||||
Reference in New Issue
Block a user