From 6c6f74e2e0607d3da6b89797fb64f6065b17b166 Mon Sep 17 00:00:00 2001 From: ivmarkov Date: Thu, 1 Jun 2023 04:59:01 +0000 Subject: [PATCH] Fix a bug in mDNS --- matter/src/mdns.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/matter/src/mdns.rs b/matter/src/mdns.rs index 7564578..eaba7ee 100644 --- a/matter/src/mdns.rs +++ b/matter/src/mdns.rs @@ -392,9 +392,9 @@ pub mod builtin { impl MdnsEntry { #[inline(always)] - const fn new() -> Self { + const fn new(key: heapless::String<64>) -> Self { Self { - key: heapless::String::new(), + key, record: heapless::Vec::new(), } } @@ -479,7 +479,7 @@ pub mod builtin { entries.retain(|entry| entry.key != key); entries - .push(MdnsEntry::new()) + .push(MdnsEntry::new(key)) .map_err(|_| ErrorCode::NoSpace)?; let entry = entries.iter_mut().last().unwrap();