From cc2eb4ef053da7a53663bdecac912a1c49490301 Mon Sep 17 00:00:00 2001 From: stale Date: Fri, 1 Jul 2022 22:14:52 -0300 Subject: fix the mess i made of type aliases --- src/livepos.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/livepos.rs') diff --git a/src/livepos.rs b/src/livepos.rs index 9112755..b19eda6 100644 --- a/src/livepos.rs +++ b/src/livepos.rs @@ -1,6 +1,7 @@ use crate::types::*; +use std::sync::Arc; use tokio::sync::mpsc as tokio_mpsc; -use tokio::sync::Mutex; +use tokio::sync::{ RwLock, Mutex }; use std::collections::{HashMap,HashSet}; use tokio::time::{self, Duration}; use warp::ws::Message; @@ -16,7 +17,7 @@ pub struct Req { pub data: ReqData, } -pub async fn livepos(players: PlayerMapData, mut recv: tokio_mpsc::UnboundedReceiver) { +pub async fn livepos(players: Arc>, mut recv: tokio_mpsc::UnboundedReceiver) { let positions = Mutex::new(HashMap::new()); let dirty = Mutex::new(HashSet::new()); let process_upds = async { -- cgit v1.2.3