From ddcf1a715b68b6d924b2afcb1a50655c5e67899a Mon Sep 17 00:00:00 2001
From: phesch <phesch@phesch.de>
Date: Wed, 26 May 2021 17:16:40 +0200
Subject: [PATCH] Fix redacted_because field being sent as a string

---
 src/pdu.rs | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/pdu.rs b/src/pdu.rs
index 34f72d5c..a72f04d2 100644
--- a/src/pdu.rs
+++ b/src/pdu.rs
@@ -74,9 +74,7 @@ impl PduEvent {
 
         self.unsigned.insert(
             "redacted_because".to_owned(),
-            serde_json::to_string(reason)
-                .expect("PduEvent::to_string always works")
-                .into(),
+            serde_json::to_value(reason).expect("to_value(PduEvent) always works"),
         );
 
         self.content = new_content.into();