mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-03 01:39:28 +02:00
minor cleanup
This commit is contained in:
parent
9d77fef008
commit
6a33eb4efa
27 changed files with 172 additions and 212 deletions
|
@ -211,30 +211,28 @@ impl MercuryManager {
|
|||
if let Some(cb) = pending.callback {
|
||||
let _ = cb.send(Err(MercuryError));
|
||||
}
|
||||
} else {
|
||||
if cmd == 0xb5 {
|
||||
self.lock(|inner| {
|
||||
let mut found = false;
|
||||
inner.subscriptions.retain(|&(ref prefix, ref sub)| {
|
||||
if response.uri.starts_with(prefix) {
|
||||
found = true;
|
||||
} else if cmd == 0xb5 {
|
||||
self.lock(|inner| {
|
||||
let mut found = false;
|
||||
inner.subscriptions.retain(|&(ref prefix, ref sub)| {
|
||||
if response.uri.starts_with(prefix) {
|
||||
found = true;
|
||||
|
||||
// if send fails, remove from list of subs
|
||||
// TODO: send unsub message
|
||||
sub.send(response.clone()).is_ok()
|
||||
} else {
|
||||
// URI doesn't match
|
||||
true
|
||||
}
|
||||
});
|
||||
|
||||
if !found {
|
||||
debug!("unknown subscription uri={}", response.uri);
|
||||
// if send fails, remove from list of subs
|
||||
// TODO: send unsub message
|
||||
sub.send(response.clone()).is_ok()
|
||||
} else {
|
||||
// URI doesn't match
|
||||
true
|
||||
}
|
||||
})
|
||||
} else if let Some(cb) = pending.callback {
|
||||
let _ = cb.send(Ok(response));
|
||||
}
|
||||
});
|
||||
|
||||
if !found {
|
||||
debug!("unknown subscription uri={}", response.uri);
|
||||
}
|
||||
})
|
||||
} else if let Some(cb) = pending.callback {
|
||||
let _ = cb.send(Ok(response));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue