From 030f23b9e914e0d27406c877f86205f2a2fb2e6c Mon Sep 17 00:00:00 2001 From: Devin Ragotzy Date: Sun, 13 Jun 2021 07:58:26 -0400 Subject: [PATCH] federation: Make all pub structs non_exhaustive --- .../src/membership/create_invite/v1.rs | 1 + .../src/membership/create_leave_event/v1.rs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/crates/ruma-federation-api/src/membership/create_invite/v1.rs b/crates/ruma-federation-api/src/membership/create_invite/v1.rs index 9b7900aa..b6a0f2df 100644 --- a/crates/ruma-federation-api/src/membership/create_invite/v1.rs +++ b/crates/ruma-federation-api/src/membership/create_invite/v1.rs @@ -82,6 +82,7 @@ impl UnsignedEventContent { } /// Initial set of fields of `Request`. +#[allow(clippy::exhaustive_structs)] pub struct RequestInit<'a> { /// The room ID that the user is being invited to. pub room_id: &'a RoomId, diff --git a/crates/ruma-federation-api/src/membership/create_leave_event/v1.rs b/crates/ruma-federation-api/src/membership/create_leave_event/v1.rs index 4ea56608..bc43c69b 100644 --- a/crates/ruma-federation-api/src/membership/create_leave_event/v1.rs +++ b/crates/ruma-federation-api/src/membership/create_leave_event/v1.rs @@ -114,4 +114,12 @@ impl Response { /// An empty object. #[derive(Clone, Debug, Default, Deserialize, Serialize)] +#[allow(clippy::exhaustive_structs)] pub struct Empty {} + +impl Empty { + /// Create a new `Empty`. + pub fn new() -> Self { + Self {} + } +}