aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiogo464 <[email protected]>2026-01-20 14:59:17 +0000
committerdiogo464 <[email protected]>2026-01-20 15:00:25 +0000
commitfde795c093c0392988cae4690b8ef85483d30162 (patch)
tree90704d39a5d11ae630fe439cbf9c5ce850d14e85
parent0c38558cb794785053dda594dd07c81746b3949d (diff)
derive default instead of manual impl for DeviceBuffersOwned
-rw-r--r--src/lib.rs16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 2d1ecfb..da99c01 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -346,6 +346,7 @@ pub struct DeviceConfig {
346 pub model: &'static str, 346 pub model: &'static str,
347} 347}
348 348
349#[derive(Default)]
349pub struct DeviceBuffersOwned { 350pub struct DeviceBuffersOwned {
350 pub publish: Vec<u8, 2048>, 351 pub publish: Vec<u8, 2048>,
351 pub subscribe: Vec<u8, 128>, 352 pub subscribe: Vec<u8, 128>,
@@ -357,21 +358,6 @@ pub struct DeviceBuffersOwned {
357 pub attributes_topic: String<128>, 358 pub attributes_topic: String<128>,
358} 359}
359 360
360impl Default for DeviceBuffersOwned {
361 fn default() -> Self {
362 Self {
363 publish: Default::default(),
364 subscribe: Default::default(),
365 discovery: Default::default(),
366 availability_topic: Default::default(),
367 discovery_topic: Default::default(),
368 state_topic: Default::default(),
369 command_topic: Default::default(),
370 attributes_topic: Default::default(),
371 }
372 }
373}
374
375impl DeviceBuffersOwned { 361impl DeviceBuffersOwned {
376 pub fn as_buffers_mut(&mut self) -> DeviceBuffers<'_> { 362 pub fn as_buffers_mut(&mut self) -> DeviceBuffers<'_> {
377 DeviceBuffers { 363 DeviceBuffers {