diff options
| author | Eskil Queseth <eskilq@kth.se> | 2021-06-13 19:15:22 +0200 |
|---|---|---|
| committer | Eskil Queseth <eskilq@kth.se> | 2021-06-13 19:15:22 +0200 |
| commit | 85c1f17d451cf30800ea2f027bcbd15074451a78 (patch) | |
| tree | 85209734caee30b7037709ef9ad4ea83dc2ecc32 /mumd/src | |
| parent | 42275c61510f38318332a20c1ee41dbc17663b13 (diff) | |
| download | mum-85c1f17d451cf30800ea2f027bcbd15074451a78.tar.gz | |
add elided-liftimes-in-paths lint
Diffstat (limited to 'mumd/src')
| -rw-r--r-- | mumd/src/main.rs | 2 | ||||
| -rw-r--r-- | mumd/src/network/tcp.rs | 6 | ||||
| -rw-r--r-- | mumd/src/state.rs | 4 |
3 files changed, 7 insertions, 5 deletions
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<Framed<TlsStream<TcpStream>, ControlCodec<Serverbound, Clientbound>>>; -pub(crate) type TcpEventCallback = Box<dyn FnOnce(TcpEventData)>; -pub(crate) type TcpEventSubscriber = Box<dyn FnMut(TcpEventData) -> bool>; //the bool indicates if it should be kept or not +pub(crate) type TcpEventCallback = Box<dyn FnOnce(TcpEventData<'_>)>; +pub(crate) type TcpEventSubscriber = Box<dyn FnMut(TcpEventData<'_>) -> 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<dyn Iterator<Item = mumlib::error::Result<Option<CommandRes //TODO give me a better name pub enum ExecutionContext { - TcpEventCallback(Vec<(TcpEvent, Box<dyn FnOnce(TcpEventData) -> Responses>)>), + TcpEventCallback(Vec<(TcpEvent, Box<dyn FnOnce(TcpEventData<'_>) -> Responses>)>), TcpEventSubscriber( TcpEvent, Box< dyn FnMut( - TcpEventData, + TcpEventData<'_>, &mut mpsc::UnboundedSender<mumlib::error::Result<Option<CommandResponse>>>, ) -> bool, >, |
