diff options
| author | Eskil Queseth <eskilq@kth.se> | 2021-06-13 20:48:54 +0200 |
|---|---|---|
| committer | Eskil Queseth <eskilq@kth.se> | 2021-06-13 20:48:54 +0200 |
| commit | 465f21da46a7194e25894043ca2cca9ba958e11c (patch) | |
| tree | 0a1dd5381263e8e8d6d09f1c0940aeb11f497e49 /mumd/src/network/tcp.rs | |
| parent | 9bc2bdc5dca1399fa75d20a18f1a2dfb8ab4e325 (diff) | |
| download | mum-465f21da46a7194e25894043ca2cca9ba958e11c.tar.gz | |
add unreachable_pub lint and fix debug impl
Diffstat (limited to 'mumd/src/network/tcp.rs')
| -rw-r--r-- | mumd/src/network/tcp.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mumd/src/network/tcp.rs b/mumd/src/network/tcp.rs index a76814c..f68dd31 100644 --- a/mumd/src/network/tcp.rs +++ b/mumd/src/network/tcp.rs @@ -14,6 +14,7 @@ use mumble_protocol::{Clientbound, Serverbound}; use mumlib::command::MumbleEventKind; use std::collections::HashMap; use std::convert::{Into, TryInto}; +use std::fmt::Debug; use std::net::SocketAddr; use std::sync::{Arc, RwLock}; use tokio::net::TcpStream; @@ -57,7 +58,7 @@ pub enum TcpEvent { /// Having two different types might feel a bit confusing. Essentially, a /// callback _registers_ to a [TcpEvent] but _takes_ a [TcpEventData] as /// parameter. -#[derive(Clone)] +#[derive(Clone, Debug)] pub enum TcpEventData<'a> { Connected(Result<&'a msgs::ServerSync, mumlib::Error>), Disconnected(DisconnectedReason), @@ -139,6 +140,13 @@ impl TcpEventQueue { } } +impl Debug for TcpEventQueue { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("TcpEventQueue") + .finish() + } +} + pub async fn handle( state: Arc<RwLock<State>>, mut connection_info_receiver: watch::Receiver<Option<ConnectionInfo>>, |
