Skip to content

Commit

Permalink
Serialize structs as maps
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Nelson committed Sep 2, 2022
1 parent 4f38c89 commit 73bfe08
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions brokers/src/redis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ where
event: impl AsRef<[u8]> + Debug,
data: &(impl Serialize + Debug),
) -> Result<Id> {
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
Expand Down Expand Up @@ -137,7 +137,7 @@ where
data: &(impl Serialize + Debug),
timeout: SystemTime,
) -> Result<Id> {
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
Expand Down
2 changes: 1 addition & 1 deletion brokers/src/redis/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 73bfe08

Please sign in to comment.