state-res: Fix state-res tests

Before, they wouldn't compile with the unstable-exhaustive-types feature
active on ruma-state-res, but not on ruma-events.
This commit is contained in:
Jonas Platte 2021-09-28 14:27:39 +02:00
parent 00ae571636
commit c6144c2299
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67

View File

@ -552,7 +552,7 @@ pub mod event {
match &self.rest {
Pdu::RoomV1Pdu(ev) => &ev.room_id,
Pdu::RoomV3Pdu(ev) => &ev.room_id,
#[cfg(not(feature = "unstable-exhaustive-types"))]
#[allow(unreachable_patterns)]
_ => unreachable!("new PDU version"),
}
}
@ -561,7 +561,7 @@ pub mod event {
match &self.rest {
Pdu::RoomV1Pdu(ev) => &ev.sender,
Pdu::RoomV3Pdu(ev) => &ev.sender,
#[cfg(not(feature = "unstable-exhaustive-types"))]
#[allow(unreachable_patterns)]
_ => unreachable!("new PDU version"),
}
}
@ -570,7 +570,7 @@ pub mod event {
match &self.rest {
Pdu::RoomV1Pdu(ev) => &ev.kind,
Pdu::RoomV3Pdu(ev) => &ev.kind,
#[cfg(not(feature = "unstable-exhaustive-types"))]
#[allow(unreachable_patterns)]
_ => unreachable!("new PDU version"),
}
}
@ -579,7 +579,7 @@ pub mod event {
match &self.rest {
Pdu::RoomV1Pdu(ev) => &ev.content,
Pdu::RoomV3Pdu(ev) => &ev.content,
#[cfg(not(feature = "unstable-exhaustive-types"))]
#[allow(unreachable_patterns)]
_ => unreachable!("new PDU version"),
}
}
@ -588,7 +588,7 @@ pub mod event {
match &self.rest {
Pdu::RoomV1Pdu(ev) => ev.origin_server_ts,
Pdu::RoomV3Pdu(ev) => ev.origin_server_ts,
#[cfg(not(feature = "unstable-exhaustive-types"))]
#[allow(unreachable_patterns)]
_ => unreachable!("new PDU version"),
}
}
@ -597,7 +597,7 @@ pub mod event {
match &self.rest {
Pdu::RoomV1Pdu(ev) => ev.state_key.as_deref(),
Pdu::RoomV3Pdu(ev) => ev.state_key.as_deref(),
#[cfg(not(feature = "unstable-exhaustive-types"))]
#[allow(unreachable_patterns)]
_ => unreachable!("new PDU version"),
}
}
@ -606,7 +606,7 @@ pub mod event {
match &self.rest {
Pdu::RoomV1Pdu(ev) => Box::new(ev.prev_events.iter().map(|(id, _)| id)),
Pdu::RoomV3Pdu(ev) => Box::new(ev.prev_events.iter()),
#[cfg(not(feature = "unstable-exhaustive-types"))]
#[allow(unreachable_patterns)]
_ => unreachable!("new PDU version"),
}
}
@ -615,7 +615,7 @@ pub mod event {
match &self.rest {
Pdu::RoomV1Pdu(ev) => Box::new(ev.auth_events.iter().map(|(id, _)| id)),
Pdu::RoomV3Pdu(ev) => Box::new(ev.auth_events.iter()),
#[cfg(not(feature = "unstable-exhaustive-types"))]
#[allow(unreachable_patterns)]
_ => unreachable!("new PDU version"),
}
}
@ -624,7 +624,7 @@ pub mod event {
match &self.rest {
Pdu::RoomV1Pdu(ev) => ev.redacts.as_ref(),
Pdu::RoomV3Pdu(ev) => ev.redacts.as_ref(),
#[cfg(not(feature = "unstable-exhaustive-types"))]
#[allow(unreachable_patterns)]
_ => unreachable!("new PDU version"),
}
}