From 7e23f80e42e4e15bc83618e510bdf50ec379556a Mon Sep 17 00:00:00 2001 From: projectmoon Date: Wed, 10 Feb 2021 20:18:47 +0000 Subject: [PATCH] Get user list: replace format! with direct string conversion. --- src/matrix.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/matrix.rs b/src/matrix.rs index d0480ab..af2be49 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -28,15 +28,10 @@ pub async fn get_users_in_room(client: &Client, room_id: &RoomId) -> Vec if let Some(joined_room) = client.get_joined_room(room_id) { let members: Vec = joined_room.joined_members().await.ok().unwrap_or_default(); - let to_username = |member: RoomMember| { - format!( - "@{}:{}", - member.user_id().localpart(), - member.user_id().server_name() - ) - }; - - members.into_iter().map(to_username).collect() + members + .into_iter() + .map(|member| member.user_id().to_string()) + .collect() } else { vec![] }