src: mqtt: Replace single-branch match with if let

This commit is contained in:
2026-09-14 16:03:57 +00:00
parent cdd841a681
commit 6169182aff
+4 -7
View File
@@ -70,13 +70,10 @@ impl MQTT {
let notification = self.eventloop.poll().await?;
debug!("Notification = {:?}", notification);
match notification {
Event::Incoming(Incoming::Publish(p)) => {
let msg: StatusMessage = serde_json::from_slice(p.payload.as_ref())?;
info!("Message: {:?}", msg);
callback(msg);
},
_ => (),
if let Event::Incoming(Incoming::Publish(p)) = notification {
let msg: StatusMessage = serde_json::from_slice(p.payload.as_ref())?;
info!("Message: {:?}", msg);
callback(msg);
}
}