Get user list: replace format! with direct string conversion.
This commit is contained in:
parent
d813198cb0
commit
7e23f80e42
|
@ -28,15 +28,10 @@ pub async fn get_users_in_room(client: &Client, room_id: &RoomId) -> Vec<String>
|
||||||
if let Some(joined_room) = client.get_joined_room(room_id) {
|
if let Some(joined_room) = client.get_joined_room(room_id) {
|
||||||
let members: Vec<RoomMember> = joined_room.joined_members().await.ok().unwrap_or_default();
|
let members: Vec<RoomMember> = joined_room.joined_members().await.ok().unwrap_or_default();
|
||||||
|
|
||||||
let to_username = |member: RoomMember| {
|
members
|
||||||
format!(
|
.into_iter()
|
||||||
"@{}:{}",
|
.map(|member| member.user_id().to_string())
|
||||||
member.user_id().localpart(),
|
.collect()
|
||||||
member.user_id().server_name()
|
|
||||||
)
|
|
||||||
};
|
|
||||||
|
|
||||||
members.into_iter().map(to_username).collect()
|
|
||||||
} else {
|
} else {
|
||||||
vec![]
|
vec![]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue