client-api: Update leave_room to new API conventions

This commit is contained in:
Jonas Platte 2020-08-11 02:03:14 +02:00
parent abeb2160ad
commit dffa60d70f
No known key found for this signature in database
GPG Key ID: 7D261D771D915378

View File

@ -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
}
}