From 9b38538579ac54c5bf4c3f391aa04cd30f42d270 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Sat, 15 May 2021 13:57:50 +0200 Subject: [PATCH] events: Simplify RawExt * Remove redundant where clause * Clean up documentation --- crates/ruma-events/src/lib.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/ruma-events/src/lib.rs b/crates/ruma-events/src/lib.rs index f657f9b3..0c746b06 100644 --- a/crates/ruma-events/src/lib.rs +++ b/crates/ruma-events/src/lib.rs @@ -284,15 +284,11 @@ pub trait RedactContent { /// Extension trait for Raw pub trait RawExt { - /// Try to deserialize the JSON as event content + /// Try to deserialize the JSON as an event's content. fn deserialize_content(self, event_type: &str) -> Result; } -impl RawExt for Raw -where - T: EventContent, -{ - /// Try to deserialize the JSON as event content +impl RawExt for Raw { fn deserialize_content(self, event_type: &str) -> Result { T::from_parts(event_type, self.into_json()) }