From 9bc2bdc5dca1399fa75d20a18f1a2dfb8ab4e325 Mon Sep 17 00:00:00 2001 From: Eskil Queseth Date: Sun, 13 Jun 2021 20:14:59 +0200 Subject: add single_use_lifetimes lint --- mumd/src/main.rs | 1 + mumd/src/network/tcp.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'mumd') diff --git a/mumd/src/main.rs b/mumd/src/main.rs index 819402d..29ea77f 100644 --- a/mumd/src/main.rs +++ b/mumd/src/main.rs @@ -1,6 +1,7 @@ #![warn(elided_lifetimes_in_paths)] #![warn(meta_variable_misuse)] #![warn(missing_debug_implementations)] //doesn't seem to work +#![warn(single_use_lifetimes)] #![deny(keyword_idents)] #![deny(macro_use_extern_crate)] #![deny(missing_abi)] diff --git a/mumd/src/network/tcp.rs b/mumd/src/network/tcp.rs index 1f226d8..a76814c 100644 --- a/mumd/src/network/tcp.rs +++ b/mumd/src/network/tcp.rs @@ -64,7 +64,7 @@ pub enum TcpEventData<'a> { TextMessage(&'a msgs::TextMessage), } -impl<'a> From<&TcpEventData<'a>> for TcpEvent { +impl From<&TcpEventData<'_>> for TcpEvent { fn from(t: &TcpEventData<'_>) -> Self { match t { TcpEventData::Connected(_) => TcpEvent::Connected, @@ -111,7 +111,7 @@ impl TcpEventQueue { /// Fires all callbacks related to a specific TCP event and removes them from the event queue. /// Also calls all event subscribers, but keeps them in the queue - pub fn resolve<'a>(&self, data: TcpEventData<'a>) { + pub fn resolve(&self, data: TcpEventData<'_>) { if let Some(vec) = self .callbacks .write() -- cgit v1.2.1