From ef48afbf418759b04af5d6752501a590511e80a0 Mon Sep 17 00:00:00 2001 From: Simon Persson Date: Tue, 20 Feb 2018 22:05:05 +0100 Subject: [PATCH] Simplify match with if let. --- playback/src/player.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/playback/src/player.rs b/playback/src/player.rs index ebf24411..c0a8a351 100644 --- a/playback/src/player.rs +++ b/playback/src/player.rs @@ -417,13 +417,11 @@ impl PlayerInternal { } fn send_event(&mut self, event: PlayerEvent) { - match self.config.event_sender { - Some(ref s) => - match s.send(event.clone()) { - Ok(_) => info!("Sent event {:?} to event listener.", event), - Err(err) => error!("Failed to send event {:?} to listener: {:?}", event, err) - } - None => () + if let Some(ref s) = self.config.event_sender { + match s.send(event.clone()) { + Ok(_) => info!("Sent event {:?} to event listener.", event), + Err(err) => error!("Failed to send event {:?} to listener: {:?}", event, err) + } } }