mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Use futures::sync::oneshot::Sender::send() instead of the deprecated complete()
This commit is contained in:
parent
a1a3a2e772
commit
644355269e
3 changed files with 6 additions and 6 deletions
|
@ -32,11 +32,11 @@ impl AudioKeyManager {
|
|||
0xd => {
|
||||
let mut key = [0u8; 16];
|
||||
key.copy_from_slice(data.as_ref());
|
||||
sender.complete(Ok(AudioKey(key)));
|
||||
let _ = sender.send(Ok(AudioKey(key)));
|
||||
}
|
||||
0xe => {
|
||||
warn!("error audio key {:x} {:x}", data.as_ref()[0], data.as_ref()[1]);
|
||||
sender.complete(Err(AudioKeyError));
|
||||
let _ = sender.send(Err(AudioKeyError));
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
|
|
@ -199,7 +199,7 @@ impl MercuryManager {
|
|||
if response.status_code >= 400 {
|
||||
warn!("error {} for uri {}", response.status_code, &response.uri);
|
||||
if let Some(cb) = pending.callback {
|
||||
cb.complete(Err(MercuryError));
|
||||
let _ = cb.send(Err(MercuryError));
|
||||
}
|
||||
} else {
|
||||
if cmd == 0xb5 {
|
||||
|
@ -223,7 +223,7 @@ impl MercuryManager {
|
|||
}
|
||||
})
|
||||
} else if let Some(cb) = pending.callback {
|
||||
cb.complete(Ok(response));
|
||||
let _ = cb.send(Ok(response));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -155,7 +155,7 @@ impl PlayerState {
|
|||
match self {
|
||||
Paused { end_of_track, .. } |
|
||||
Playing { end_of_track, .. } => {
|
||||
end_of_track.complete(())
|
||||
let _ = end_of_track.send(());
|
||||
}
|
||||
|
||||
Stopped => warn!("signal_end_of_track from stopped state"),
|
||||
|
@ -313,7 +313,7 @@ impl PlayerInternal {
|
|||
}
|
||||
|
||||
None => {
|
||||
end_of_track.complete(());
|
||||
let _ = end_of_track.send(());
|
||||
if self.state.is_playing() {
|
||||
self.run_onstop();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue