Small clippy cleanups

This commit is contained in:
Luke D. Jones
2025-01-04 20:04:07 +13:00
parent 2b7a2a5be3
commit 2123f369ad
6 changed files with 25 additions and 26 deletions

View File

@@ -125,10 +125,8 @@ impl AsusArmouryAttribute {
#[zbus(property)]
async fn current_value(&self) -> fdo::Result<i32> {
if let Ok(v) = self.0.current_value() {
if let AttrValue::Integer(i) = v {
return Ok(i);
}
if let Ok(AttrValue::Integer(i)) = self.0.current_value() {
return Ok(i);
}
Err(fdo::Error::Failed(
"Could not read current value".to_string(),

View File

@@ -213,7 +213,7 @@ impl DeviceManager {
) -> Option<AsusDevice> {
// "ID_MODEL_ID" "1932"
// "ID_VENDOR_ID" "0b05"
if dev_prop_matches(&device, "ID_VENDOR_ID", "0b05") {
if dev_prop_matches(device, "ID_VENDOR_ID", "0b05") {
if let Some(dev_node) = device.devnode() {
let prod_id = device
.property_value("ID_MODEL_ID")
@@ -426,14 +426,11 @@ impl DeviceManager {
info!("removing: {path:?}");
let dev = devices.lock().await.remove(index);
let path = path.clone();
match dev.device {
DeviceHandle::Scsi(_) => {
conn_copy
.object_server()
.remove::<ScsiZbus, _>(&path)
.await?;
}
_ => {}
if let DeviceHandle::Scsi(_) = dev.device {
conn_copy
.object_server()
.remove::<ScsiZbus, _>(&path)
.await?;
}
}
} else if action == "add" {