set works

This commit is contained in:
Sebastian Moser
2024-08-20 10:30:36 +02:00
parent 410198b099
commit 125c4b066a
2 changed files with 3 additions and 3 deletions

View File

@@ -216,16 +216,18 @@ impl MizeMessage {
let data = {
let mut tmp_val = &CborValue::Null;
let mut found = false;
for (key, val) in msg_as_map {
if let CborValue::Integer(key_int) = key {
// number three indicates the data field
let three: Integer = 3.into();
if key_int == &three {
tmp_val = val;
found = true;
}
}
}
if tmp_val == &CborValue::Null {
if ! found {
return Err(MizeError::new().msg("error getting the data value form a msg"));
}
tmp_val