From 6169182affaa6e2ee1fe5b197651328c1e712af0 Mon Sep 17 00:00:00 2001 From: mirsal Date: Mon, 14 Sep 2026 16:03:57 +0000 Subject: [PATCH] src: mqtt: Replace single-branch match with if let --- src/mqtt.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/mqtt.rs b/src/mqtt.rs index e162dc9..85a9a05 100644 --- a/src/mqtt.rs +++ b/src/mqtt.rs @@ -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); } }