Mark PinnedEventsEventContent as non_exhaustive

This commit is contained in:
Jonas Platte 2020-07-25 03:04:19 +02:00
parent be175bbae6
commit 08fbace022
No known key found for this signature in database
GPG Key ID: 7D261D771D915378

View File

@ -11,12 +11,20 @@ pub type PinnedEventsEvent = StateEvent<PinnedEventsEventContent>;
/// The payload for `PinnedEventsEvent`.
#[derive(Clone, Debug, Deserialize, Serialize, StateEventContent)]
#[non_exhaustive]
#[ruma_event(type = "m.room.pinned_events")]
pub struct PinnedEventsEventContent {
/// An ordered list of event IDs to pin.
pub pinned: Vec<EventId>,
}
impl PinnedEventsEventContent {
/// Creates a new `PinnedEventsEventContent` with the given events.
pub fn new(pinned: Vec<EventId>) -> Self {
Self { pinned }
}
}
#[cfg(test)]
mod tests {
use std::{