From 465f21da46a7194e25894043ca2cca9ba958e11c Mon Sep 17 00:00:00 2001 From: Eskil Queseth Date: Sun, 13 Jun 2021 20:48:54 +0200 Subject: add unreachable_pub lint and fix debug impl --- mumd/src/network/tcp.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mumd/src/network/tcp.rs') 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>, mut connection_info_receiver: watch::Receiver>, -- cgit v1.2.1