From 73bfe081b85ce19eefbfebdb3b06c2a6a9903d91 Mon Sep 17 00:00:00 2001 From: Will Nelson Date: Thu, 1 Sep 2022 21:13:16 -0700 Subject: [PATCH] Serialize structs as maps --- brokers/src/redis.rs | 4 ++-- brokers/src/redis/message.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/brokers/src/redis.rs b/brokers/src/redis.rs index aeae717..0bf42d5 100644 --- a/brokers/src/redis.rs +++ b/brokers/src/redis.rs @@ -93,7 +93,7 @@ where event: impl AsRef<[u8]> + Debug, data: &(impl Serialize + Debug), ) -> Result { - let serialized_data = rmp_serde::to_vec(data)?; + let serialized_data = rmp_serde::to_vec_named(data)?; let mut conn = self.pool.get().await?; let data = conn @@ -137,7 +137,7 @@ where data: &(impl Serialize + Debug), timeout: SystemTime, ) -> Result { - let serialized_data = rmp_serde::to_vec(data)?; + let serialized_data = rmp_serde::to_vec_named(data)?; let mut conn = self.pool.get().await?; let timeout_bytes = timeout diff --git a/brokers/src/redis/message.rs b/brokers/src/redis/message.rs index ed2b438..1806b8e 100644 --- a/brokers/src/redis/message.rs +++ b/brokers/src/redis/message.rs @@ -104,7 +104,7 @@ where let mut key = self.event.to_vec(); write!(key, ":{}", self.id)?; - let serialized = rmp_serde::to_vec(data)?; + let serialized = rmp_serde::to_vec_named(data)?; self.broker .pool .get()