More refactoring

This commit is contained in:
2023-08-18 03:07:16 +02:00
parent 3134891751
commit 044c38ba86
20 changed files with 209 additions and 105 deletions

View File

@@ -59,7 +59,7 @@ impl OnMqtt for Presence {
.find('+')
.or(self.mqtt.topic.find('#'))
.expect("Presence::create fails if it does not contain wildcards");
let device_name = message.topic[offset..].to_owned();
let device_name = message.topic[offset..].into();
if message.payload.is_empty() {
// Remove the device from the map