From 078d90dfde45c9ab2d2b8b0369713ed46bd2d536 Mon Sep 17 00:00:00 2001 From: Dave Townsend Date: Thu, 5 Dec 2024 09:27:07 +0000 Subject: [PATCH] Fix nightly fmt --- src/homeassistant/ser.rs | 4 +--- src/io.rs | 26 +++++++++++++++++++++++--- src/topic.rs | 8 ++++++-- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/homeassistant/ser.rs b/src/homeassistant/ser.rs index b6a76a9..e7dd65d 100644 --- a/src/homeassistant/ser.rs +++ b/src/homeassistant/ser.rs @@ -73,9 +73,7 @@ pub(super) struct DiscoverySerializer<'a, const A: usize, C: Component, S: Seria pub(super) inner: S, } -impl Serializer - for DiscoverySerializer<'_, A, C, S> -{ +impl Serializer for DiscoverySerializer<'_, A, C, S> { type Ok = S::Ok; type Error = S::Error; type SerializeSeq = S::SerializeSeq; diff --git a/src/io.rs b/src/io.rs index c48a32b..00f49b3 100644 --- a/src/io.rs +++ b/src/io.rs @@ -19,12 +19,32 @@ use embassy_sync::{ use embassy_time::Timer; use embedded_io_async::Write; use mqttrs::{ - decode_slice, Connect, ConnectReturnCode, LastWill, Packet, Pid, Protocol, Publish, QoS, QosPid, + decode_slice, + Connect, + ConnectReturnCode, + LastWill, + Packet, + Pid, + Protocol, + Publish, + QoS, + QosPid, }; use crate::{ - device_id, Buffer, ControlMessage, Error, MqttMessage, Payload, Publishable, Topic, - TopicString, CONFIRMATION_TIMEOUT, DATA_CHANNEL, DEFAULT_BACKOFF, RESET_BACKOFF, + device_id, + Buffer, + ControlMessage, + Error, + MqttMessage, + Payload, + Publishable, + Topic, + TopicString, + CONFIRMATION_TIMEOUT, + DATA_CHANNEL, + DEFAULT_BACKOFF, + RESET_BACKOFF, }; static WRITE_BUFFER: Mutex> = Mutex::new(Buffer::new()); diff --git a/src/topic.rs b/src/topic.rs index e17a0d3..8901038 100644 --- a/src/topic.rs +++ b/src/topic.rs @@ -9,10 +9,14 @@ use mqttrs::{Packet, QoS, Subscribe, SubscribeReturnCodes, SubscribeTopic, Unsub #[cfg(feature = "serde")] use crate::publish::PublishJson; use crate::{ - device_id, device_type, + device_id, + device_type, io::{assign_pid, send_packet, subscribe}, publish::{PublishBytes, PublishDisplay}, - ControlMessage, Error, TopicString, CONFIRMATION_TIMEOUT, + ControlMessage, + Error, + TopicString, + CONFIRMATION_TIMEOUT, }; /// An MQTT topic that is optionally prefixed with the device type and unique ID.