From 85c1f17d451cf30800ea2f027bcbd15074451a78 Mon Sep 17 00:00:00 2001 From: Eskil Queseth Date: Sun, 13 Jun 2021 19:15:22 +0200 Subject: add elided-liftimes-in-paths lint --- mumd/src/main.rs | 2 ++ mumd/src/network/tcp.rs | 6 +++--- mumd/src/state.rs | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'mumd') diff --git a/mumd/src/main.rs b/mumd/src/main.rs index bc72779..825251e 100644 --- a/mumd/src/main.rs +++ b/mumd/src/main.rs @@ -1,3 +1,5 @@ +#![warn(elided_lifetimes_in_paths)] + mod audio; mod client; mod command; diff --git a/mumd/src/network/tcp.rs b/mumd/src/network/tcp.rs index f620a32..1f226d8 100644 --- a/mumd/src/network/tcp.rs +++ b/mumd/src/network/tcp.rs @@ -31,8 +31,8 @@ type TcpSender = SplitSink< type TcpReceiver = SplitStream, ControlCodec>>; -pub(crate) type TcpEventCallback = Box; -pub(crate) type TcpEventSubscriber = Box bool>; //the bool indicates if it should be kept or not +pub(crate) type TcpEventCallback = Box)>; +pub(crate) type TcpEventSubscriber = Box) -> bool>; //the bool indicates if it should be kept or not /// Why the TCP was disconnected. #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] @@ -65,7 +65,7 @@ pub enum TcpEventData<'a> { } impl<'a> From<&TcpEventData<'a>> for TcpEvent { - fn from(t: &TcpEventData) -> Self { + fn from(t: &TcpEventData<'_>) -> Self { match t { TcpEventData::Connected(_) => TcpEvent::Connected, TcpEventData::Disconnected(reason) => TcpEvent::Disconnected(*reason), diff --git a/mumd/src/state.rs b/mumd/src/state.rs index d2d77b1..9d9e1c6 100644 --- a/mumd/src/state.rs +++ b/mumd/src/state.rs @@ -44,12 +44,12 @@ type Responses = Box Responses>)>), + TcpEventCallback(Vec<(TcpEvent, Box) -> Responses>)>), TcpEventSubscriber( TcpEvent, Box< dyn FnMut( - TcpEventData, + TcpEventData<'_>, &mut mpsc::UnboundedSender>>, ) -> bool, >, -- cgit v1.2.1