|
|
|
@ -532,15 +532,11 @@ pub async fn get_public_rooms_filtered_route( |
|
|
|
.map(|c| { |
|
|
|
.map(|c| { |
|
|
|
// Convert ruma::api::federation::directory::get_public_rooms::v1::PublicRoomsChunk
|
|
|
|
// Convert ruma::api::federation::directory::get_public_rooms::v1::PublicRoomsChunk
|
|
|
|
// to ruma::api::client::r0::directory::PublicRoomsChunk
|
|
|
|
// to ruma::api::client::r0::directory::PublicRoomsChunk
|
|
|
|
Ok::<_, Error>( |
|
|
|
|
|
|
|
serde_json::from_str( |
|
|
|
serde_json::from_str( |
|
|
|
&serde_json::to_string(&c) |
|
|
|
&serde_json::to_string(&c).expect("PublicRoomsChunk::to_string always works"), |
|
|
|
.expect("PublicRoomsChunk::to_string always works"), |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
.expect("federation and client-server PublicRoomsChunk are the same type"), |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
.expect("federation and client-server PublicRoomsChunk are the same type") |
|
|
|
}) |
|
|
|
}) |
|
|
|
.filter_map(|r| r.ok()) |
|
|
|
|
|
|
|
.collect(), |
|
|
|
.collect(), |
|
|
|
prev_batch: response.prev_batch, |
|
|
|
prev_batch: response.prev_batch, |
|
|
|
next_batch: response.next_batch, |
|
|
|
next_batch: response.next_batch, |
|
|
|
@ -580,15 +576,11 @@ pub async fn get_public_rooms_route( |
|
|
|
.map(|c| { |
|
|
|
.map(|c| { |
|
|
|
// Convert ruma::api::federation::directory::get_public_rooms::v1::PublicRoomsChunk
|
|
|
|
// Convert ruma::api::federation::directory::get_public_rooms::v1::PublicRoomsChunk
|
|
|
|
// to ruma::api::client::r0::directory::PublicRoomsChunk
|
|
|
|
// to ruma::api::client::r0::directory::PublicRoomsChunk
|
|
|
|
Ok::<_, Error>( |
|
|
|
|
|
|
|
serde_json::from_str( |
|
|
|
serde_json::from_str( |
|
|
|
&serde_json::to_string(&c) |
|
|
|
&serde_json::to_string(&c).expect("PublicRoomsChunk::to_string always works"), |
|
|
|
.expect("PublicRoomsChunk::to_string always works"), |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
.expect("federation and client-server PublicRoomsChunk are the same type"), |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
.expect("federation and client-server PublicRoomsChunk are the same type") |
|
|
|
}) |
|
|
|
}) |
|
|
|
.filter_map(|r| r.ok()) |
|
|
|
|
|
|
|
.collect(), |
|
|
|
.collect(), |
|
|
|
prev_batch: response.prev_batch, |
|
|
|
prev_batch: response.prev_batch, |
|
|
|
next_batch: response.next_batch, |
|
|
|
next_batch: response.next_batch, |
|
|
|
|