From a165c434601192c100e5e7b920bfe8dbad19a11f Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Fri, 14 Aug 2020 00:30:25 +0200 Subject: [PATCH] Make some request and response types non-exhaustive --- ruma-client-api/src/r0/membership/join_room_by_id.rs | 2 ++ ruma-client-api/src/r0/membership/leave_room.rs | 2 ++ ruma-client-api/src/r0/message/get_message_events.rs | 1 + ruma-client-api/src/r0/room/create_room.rs | 2 ++ ruma-client-api/src/unversioned/discover_homeserver.rs | 2 ++ ruma-client-api/src/unversioned/get_supported_versions.rs | 2 ++ 6 files changed, 11 insertions(+) diff --git a/ruma-client-api/src/r0/membership/join_room_by_id.rs b/ruma-client-api/src/r0/membership/join_room_by_id.rs index 8cd968cd..6deb50a2 100644 --- a/ruma-client-api/src/r0/membership/join_room_by_id.rs +++ b/ruma-client-api/src/r0/membership/join_room_by_id.rs @@ -15,6 +15,7 @@ ruma_api! { requires_authentication: true, } + #[non_exhaustive] request: { /// The room where the user should be invited. #[ruma_api(path)] @@ -26,6 +27,7 @@ ruma_api! { pub third_party_signed: Option>, } + #[non_exhaustive] response: { /// The room that the user joined. pub room_id: RoomId, diff --git a/ruma-client-api/src/r0/membership/leave_room.rs b/ruma-client-api/src/r0/membership/leave_room.rs index 0ee583b7..ced581c6 100644 --- a/ruma-client-api/src/r0/membership/leave_room.rs +++ b/ruma-client-api/src/r0/membership/leave_room.rs @@ -13,12 +13,14 @@ ruma_api! { requires_authentication: true, } + #[non_exhaustive] request: { /// The room to leave. #[ruma_api(path)] pub room_id: &'a RoomId, } + #[non_exhaustive] response: {} error: crate::Error diff --git a/ruma-client-api/src/r0/message/get_message_events.rs b/ruma-client-api/src/r0/message/get_message_events.rs index 9bd7062e..a6ed4159 100644 --- a/ruma-client-api/src/r0/message/get_message_events.rs +++ b/ruma-client-api/src/r0/message/get_message_events.rs @@ -19,6 +19,7 @@ ruma_api! { requires_authentication: true, } + #[non_exhaustive] request: { /// The room to get events from. #[ruma_api(path)] diff --git a/ruma-client-api/src/r0/room/create_room.rs b/ruma-client-api/src/r0/room/create_room.rs index 01ae0070..690fbd17 100644 --- a/ruma-client-api/src/r0/room/create_room.rs +++ b/ruma-client-api/src/r0/room/create_room.rs @@ -27,6 +27,7 @@ ruma_api! { requires_authentication: true, } + #[non_exhaustive] request: { /// Extra keys to be added to the content of the `m.room.create`. #[serde(skip_serializing_if = "Option::is_none")] @@ -86,6 +87,7 @@ ruma_api! { pub visibility: Option, } + #[non_exhaustive] response: { /// The created room's ID. pub room_id: RoomId, diff --git a/ruma-client-api/src/unversioned/discover_homeserver.rs b/ruma-client-api/src/unversioned/discover_homeserver.rs index c184c561..a0f9c4b0 100644 --- a/ruma-client-api/src/unversioned/discover_homeserver.rs +++ b/ruma-client-api/src/unversioned/discover_homeserver.rs @@ -13,8 +13,10 @@ ruma_api! { requires_authentication: false, } + #[non_exhaustive] request: {} + #[non_exhaustive] response: { /// Information about the homeserver to connect to. #[serde(rename = "m.homeserver")] diff --git a/ruma-client-api/src/unversioned/get_supported_versions.rs b/ruma-client-api/src/unversioned/get_supported_versions.rs index 55888634..14727f23 100644 --- a/ruma-client-api/src/unversioned/get_supported_versions.rs +++ b/ruma-client-api/src/unversioned/get_supported_versions.rs @@ -14,8 +14,10 @@ ruma_api! { requires_authentication: false, } + #[non_exhaustive] request: {} + #[non_exhaustive] response: { /// A list of Matrix client API protocol versions supported by the homeserver. pub versions: Vec,