lint clippy::collapsible_match (nightly)

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-05-19 10:56:59 +00:00 committed by June 🍓🦴
parent 362649ff87
commit 1f3a9a40e5

View file

@ -328,20 +328,17 @@ impl PduEvent {
unsigned.remove("transaction_id");
}
// room v3 and above removed the "event_id" field from remote PDU format
if let Some(room_id) = pdu_json
.get("room_id")
.and_then(|val| RoomId::parse(val.as_str()?).ok())
{
if let Ok(room_version_id) = services().rooms.state.get_room_version(&room_id) {
// room v3 and above removed the "event_id" field from remote PDU format
match room_version_id {
match services().rooms.state.get_room_version(&room_id) {
Ok(room_version_id) => match room_version_id {
RoomVersionId::V1 | RoomVersionId::V2 => {},
_ => {
pdu_json.remove("event_id");
},
};
} else {
pdu_json.remove("event_id");
_ => _ = pdu_json.remove("event_id"),
},
Err(_) => _ = pdu_json.remove("event_id"),
}
} else {
pdu_json.remove("event_id");