mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Simplify match with if let.
This commit is contained in:
parent
3e2e6d63f7
commit
ef48afbf41
1 changed files with 5 additions and 7 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue