diff options
| author | diogo464 <[email protected]> | 2026-01-20 14:59:17 +0000 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2026-01-20 15:00:25 +0000 |
| commit | fde795c093c0392988cae4690b8ef85483d30162 (patch) | |
| tree | 90704d39a5d11ae630fe439cbf9c5ce850d14e85 /src | |
| parent | 0c38558cb794785053dda594dd07c81746b3949d (diff) | |
derive default instead of manual impl for DeviceBuffersOwned
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 16 |
1 files changed, 1 insertions, 15 deletions
| @@ -346,6 +346,7 @@ pub struct DeviceConfig { | |||
| 346 | pub model: &'static str, | 346 | pub model: &'static str, |
| 347 | } | 347 | } |
| 348 | 348 | ||
| 349 | #[derive(Default)] | ||
| 349 | pub struct DeviceBuffersOwned { | 350 | pub 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 | ||
| 360 | impl 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 | |||
| 375 | impl DeviceBuffersOwned { | 361 | impl DeviceBuffersOwned { |
| 376 | pub fn as_buffers_mut(&mut self) -> DeviceBuffers<'_> { | 362 | pub fn as_buffers_mut(&mut self) -> DeviceBuffers<'_> { |
| 377 | DeviceBuffers { | 363 | DeviceBuffers { |
