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 => {
|
0xd => {
|
||||||
let mut key = [0u8; 16];
|
let mut key = [0u8; 16];
|
||||||
key.copy_from_slice(data.as_ref());
|
key.copy_from_slice(data.as_ref());
|
||||||
sender.complete(Ok(AudioKey(key)));
|
let _ = sender.send(Ok(AudioKey(key)));
|
||||||
}
|
}
|
||||||
0xe => {
|
0xe => {
|
||||||
warn!("error audio key {:x} {:x}", data.as_ref()[0], data.as_ref()[1]);
|
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 {
|
if response.status_code >= 400 {
|
||||||
warn!("error {} for uri {}", response.status_code, &response.uri);
|
warn!("error {} for uri {}", response.status_code, &response.uri);
|
||||||
if let Some(cb) = pending.callback {
|
if let Some(cb) = pending.callback {
|
||||||
cb.complete(Err(MercuryError));
|
let _ = cb.send(Err(MercuryError));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if cmd == 0xb5 {
|
if cmd == 0xb5 {
|
||||||
|
@ -223,7 +223,7 @@ impl MercuryManager {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else if let Some(cb) = pending.callback {
|
} else if let Some(cb) = pending.callback {
|
||||||
cb.complete(Ok(response));
|
let _ = cb.send(Ok(response));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ impl PlayerState {
|
||||||
match self {
|
match self {
|
||||||
Paused { end_of_track, .. } |
|
Paused { end_of_track, .. } |
|
||||||
Playing { 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"),
|
Stopped => warn!("signal_end_of_track from stopped state"),
|
||||||
|
@ -313,7 +313,7 @@ impl PlayerInternal {
|
||||||
}
|
}
|
||||||
|
|
||||||
None => {
|
None => {
|
||||||
end_of_track.complete(());
|
let _ = end_of_track.send(());
|
||||||
if self.state.is_playing() {
|
if self.state.is_playing() {
|
||||||
self.run_onstop();
|
self.run_onstop();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue