aboutsummaryrefslogtreecommitdiffstats
path: root/mumd/src/client.rs
diff options
context:
space:
mode:
authorRubens Brandao <git@rubens.io>2021-04-05 16:04:19 +0200
committerRubens Brandao <git@rubens.io>2021-04-09 20:00:15 +0200
commita39934e562fd2755fcb7b1ed271bcf3f31aaa0d5 (patch)
tree18bb7644fb95946ebf1c0f284b0f92bbe8eae6d8 /mumd/src/client.rs
parent07d06b6946e23ecffbf5549376cf464013222274 (diff)
downloadmum-a39934e562fd2755fcb7b1ed271bcf3f31aaa0d5.tar.gz
Replace State tokio::sync::Mutex by std::sync::RwLock
Diffstat (limited to 'mumd/src/client.rs')
-rw-r--r--mumd/src/client.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/mumd/src/client.rs b/mumd/src/client.rs
index c1a0152..9c2c2a0 100644
--- a/mumd/src/client.rs
+++ b/mumd/src/client.rs
@@ -6,8 +6,8 @@ use crate::state::State;
use futures_util::{select, FutureExt};
use mumble_protocol::{Serverbound, control::ControlPacket, crypt::ClientCryptState};
use mumlib::command::{Command, CommandResponse};
-use std::sync::Arc;
-use tokio::sync::{Mutex, mpsc, oneshot, watch};
+use std::sync::{Arc, RwLock};
+use tokio::sync::{mpsc, oneshot, watch};
pub async fn handle(
state: State,
@@ -27,7 +27,7 @@ pub async fn handle(
let (response_sender, response_receiver) =
mpsc::unbounded_channel();
- let state = Arc::new(Mutex::new(state));
+ let state = Arc::new(RwLock::new(state));
select! {
r = tcp::handle(