Skip to content

Commit 8e9d888

Browse files
committed
Fix a bug in mDNS
1 parent b94484b commit 8e9d888

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

matter/src/mdns.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,9 @@ pub mod builtin {
392392

393393
impl MdnsEntry {
394394
#[inline(always)]
395-
const fn new() -> Self {
395+
const fn new(key: heapless::String<64>) -> Self {
396396
Self {
397-
key: heapless::String::new(),
397+
key,
398398
record: heapless::Vec::new(),
399399
}
400400
}
@@ -479,7 +479,7 @@ pub mod builtin {
479479

480480
entries.retain(|entry| entry.key != key);
481481
entries
482-
.push(MdnsEntry::new())
482+
.push(MdnsEntry::new(key))
483483
.map_err(|_| ErrorCode::NoSpace)?;
484484

485485
let entry = entries.iter_mut().last().unwrap();

0 commit comments

Comments
 (0)