From 401c6983b9b83ed830c8f0030ab4564b7931f6a3 Mon Sep 17 00:00:00 2001 From: Devdutt Shenoi Date: Mon, 14 Oct 2024 16:26:04 +0530 Subject: [PATCH] style: don't warn, rm unnecessary handling --- uplink/src/base/serializer/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/uplink/src/base/serializer/mod.rs b/uplink/src/base/serializer/mod.rs index f0bc0c32..c4acaa4c 100644 --- a/uplink/src/base/serializer/mod.rs +++ b/uplink/src/base/serializer/mod.rs @@ -183,10 +183,8 @@ impl Storage { // ## Panic // When any packet other than a publish is deserialized. pub fn read(&mut self, max_packet_size: usize) -> Option { - if self.live_data_first && self.latest_data.is_some() { - return self.latest_data.take(); - } else if self.latest_data.is_some() { - warn!("Latest data should be unoccupied if not using the live data first scheme"); + if let Some(publish) = self.latest_data.take() { + return Some(publish); } // TODO(RT): This can fail when packet sizes > max_payload_size in config are written to disk.