From 9c9b1f7e9382a50ec17e385b3aa13b31db7ba45d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Fri, 29 Nov 2024 11:56:54 +0100 Subject: [PATCH] serde: Improve docs of Raw --- crates/ruma-common/src/serde/raw.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/ruma-common/src/serde/raw.rs b/crates/ruma-common/src/serde/raw.rs index 7be90ffb..c8519749 100644 --- a/crates/ruma-common/src/serde/raw.rs +++ b/crates/ruma-common/src/serde/raw.rs @@ -16,8 +16,9 @@ use serde_json::value::{to_raw_value as to_raw_json_value, RawValue as RawJsonVa /// Ruma offers the `Raw` wrapper to enable passing around JSON text that is only partially /// validated. This is useful when a client receives events that do not follow the spec perfectly /// or a server needs to generate reference hashes with the original canonical JSON string. -/// All event structs and enums implement `Serialize` / `Deserialize`, `Raw` should be used -/// to pass around events in a lossless way. +/// All structs and enums representing event types implement `Deserialize`, therefore they can be +/// used with `Raw`. Since `Raw` does not change the JSON string, it should be used to pass around +/// events in a lossless way. /// /// ```no_run /// # use serde::Deserialize;