From dffa60d70f6d76306c117e29dab1e73cb8f5acd6 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Tue, 11 Aug 2020 02:03:14 +0200 Subject: [PATCH] client-api: Update leave_room to new API conventions --- ruma-client-api/src/r0/membership/leave_room.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ruma-client-api/src/r0/membership/leave_room.rs b/ruma-client-api/src/r0/membership/leave_room.rs index 99a22b12..0ee583b7 100644 --- a/ruma-client-api/src/r0/membership/leave_room.rs +++ b/ruma-client-api/src/r0/membership/leave_room.rs @@ -16,10 +16,24 @@ ruma_api! { request: { /// The room to leave. #[ruma_api(path)] - pub room_id: RoomId, + pub room_id: &'a RoomId, } response: {} error: crate::Error } + +impl<'a> Request<'a> { + /// Creates a new `Request` with the given room id. + pub fn new(room_id: &'a RoomId) -> Self { + Self { room_id } + } +} + +impl Response { + /// Creates an empty `Response`. + pub fn new() -> Self { + Self + } +}