From 7bb6c66051e8cbff4198e9f7fa7272d70af64c71 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Fri, 17 Jul 2020 01:21:59 +0200 Subject: [PATCH] Mark GuestAccessEventContent as non_exhaustive --- ruma-events/src/room/guest_access.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ruma-events/src/room/guest_access.rs b/ruma-events/src/room/guest_access.rs index ed6d72ae..d506240d 100644 --- a/ruma-events/src/room/guest_access.rs +++ b/ruma-events/src/room/guest_access.rs @@ -14,12 +14,20 @@ pub type GuestAccessEvent = StateEvent; /// The payload for `GuestAccessEvent`. #[derive(Clone, Debug, Deserialize, Serialize, StateEventContent)] +#[non_exhaustive] #[ruma_event(type = "m.room.guest_access")] pub struct GuestAccessEventContent { /// A policy for guest user access to a room. pub guest_access: GuestAccess, } +impl GuestAccessEventContent { + /// Creates a new `GuestAccessEventContent` with the given policy. + pub fn new(guest_access: GuestAccess) -> Self { + Self { guest_access } + } +} + /// A policy for guest user access to a room. #[derive(Clone, Copy, Debug, PartialEq, Display, EnumString, Deserialize, Serialize)] #[non_exhaustive]