Remove pointless double deserialization

This commit is contained in:
Jonas Platte 2021-06-17 20:29:02 +02:00
parent 7fa54e4411
commit af2ce5803e
No known key found for this signature in database
GPG key ID: CC154DE0E30B7C67

View file

@ -286,10 +286,8 @@ pub async fn sync_events_route(
.filter(|(_, pdu)| pdu.kind == EventType::RoomMember)
.map(|(_, pdu)| {
let content = serde_json::from_value::<
Raw<ruma::events::room::member::MemberEventContent>,
ruma::events::room::member::MemberEventContent,
>(pdu.content.clone())
.expect("Raw::from_value always works")
.deserialize()
.map_err(|_| {
Error::bad_database("Invalid member event in database.")
})?;