diff --git a/src/main.rs b/src/main.rs index 56f454d..66d4101 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1204,10 +1204,12 @@ fn main() { // For each match, get the score for (_, division) in &mut event.divisions { for m in &mut division.matches { + let serialized = serde_json::to_string_pretty(&m.info).unwrap(); + client.publish(m.tuple.topic(""), QoS::AtLeastOnce, true, serialized).expect("MQTT publish fail"); m.score = get_match_score(&tm_connection, struct_tuple_to_tm(m.tuple)); if let Some(score) = &m.score { - let serialized = serde_json::to_string_pretty(score).unwrap(); - client.publish(m.tuple.topic("/score"), QoS::AtLeastOnce, true, serialized).expect("MQTT publish fail"); + let serialized_score = serde_json::to_string_pretty(score).unwrap(); + client.publish(m.tuple.topic("/score"), QoS::AtLeastOnce, true, serialized_score).expect("MQTT publish fail"); } } }