Skip to content

Commit

Permalink
Enforce Protobuf Measuring
Browse files Browse the repository at this point in the history
  • Loading branch information
Peyton-McKee committed Feb 23, 2024
1 parent e52872f commit 3f3a128
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mqtt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ impl Client for MqttClient {
if let Some(client) = &self.client {
let msg = mqtt::MessageBuilder::new()
.topic(topic)
.payload(payload.write_to_bytes().unwrap())
.payload(
protobuf::Message::write_to_bytes(&payload)
.unwrap_or("failed to serialize".as_bytes().to_vec()),
)
.finalize();

match client.publish(msg) {
Expand Down

0 comments on commit 3f3a128

Please sign in to comment.