chore: Use HashMap::get
instead of Iter::find
Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
parent
05167042be
commit
48acab2519
1 changed files with 1 additions and 1 deletions
|
@ -130,7 +130,7 @@ impl OnlineUsersExt for OnlineUsers {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn send(&self, conn_id: &Uuid, event: ServerEvent<Unsigned>) {
|
async fn send(&self, conn_id: &Uuid, event: ServerEvent<Unsigned>) {
|
||||||
if let Some((_, user)) = self.read().await.iter().find(|(c, _)| *c == conn_id) {
|
if let Some(user) = self.read().await.get(conn_id) {
|
||||||
let _ = user
|
let _ = user
|
||||||
.sender
|
.sender
|
||||||
.unbounded_send(Ok(event.sign(&user.shared_secret).as_ref().into()));
|
.unbounded_send(Ok(event.sign(&user.shared_secret).as_ref().into()));
|
||||||
|
|
Loading…
Reference in a new issue