chore: Use HashMap::get instead of Iter::find
Some checks failed
DCO checker / DCO checker (pull_request) Successful in 3s
Rust CI / Rust CI (pull_request) Has been cancelled

Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb 2024-07-17 19:35:37 +03:00
parent 05167042be
commit 48acab2519
Signed by: awiteb
GPG key ID: 3F6B55640AA6682F

View file

@ -130,7 +130,7 @@ impl OnlineUsersExt for OnlineUsers {
}
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
.sender
.unbounded_send(Ok(event.sign(&user.shared_secret).as_ref().into()));