Fixed failures

This commit is contained in:
Ondrej Babec
2022-02-20 15:49:34 +01:00
parent 7218cb2a06
commit 6f0d2d5de4
5 changed files with 43 additions and 16 deletions

View File

@@ -107,12 +107,14 @@ impl<'a> BuffWriter<'a> {
pub fn encode_properties<const LEN: usize>(& mut self, properties: & Vec<Property<'a>, LEN>) {
let mut i = 0;
loop {
let prop: &Property = properties.get(i).unwrap();
self.encode_property(prop);
i = i + 1;
if i == LEN {
break;
if properties.len() != 0 {
loop {
let prop: &Property = properties.get(i).unwrap();
self.encode_property(prop);
i = i + 1;
if i == LEN {
break;
}
}
}
}
@@ -129,6 +131,7 @@ impl<'a> BuffWriter<'a> {
loop {
let topic_filter: & TopicFilter<'a> = filters.get(i).unwrap();
self.encode_topic_filter_ref(sub, topic_filter);
i = i + 1;
if i == len {
break;
}