Use futures::sync::mpsc::UnboundedSender::unbounded_send() instead of the deprecated send()

This commit is contained in:
Thomas Bächler 2018-01-21 20:38:30 +01:00
parent 5237203899
commit 630de8c0a9
6 changed files with 13 additions and 13 deletions

View file

@ -340,7 +340,7 @@ impl Seek for AudioFileStreaming {
// Notify the fetch thread to get the correct block
// This can fail if fetch thread has completed, in which case the
// block is ready. Just ignore the error.
let _ = self.seek.send(self.position);
let _ = self.seek.unbounded_send(self.position);
Ok(self.position)
}
}

View file

@ -61,7 +61,7 @@ impl ChannelManager {
self.lock(|inner| {
if let Entry::Occupied(entry) = inner.channels.entry(id) {
let _ = entry.get().send((cmd, data));
let _ = entry.get().unbounded_send((cmd, data));
}
});
}

View file

@ -211,7 +211,7 @@ impl MercuryManager {
// if send fails, remove from list of subs
// TODO: send unsub message
sub.send(response.clone()).is_ok()
sub.unbounded_send(response.clone()).is_ok()
} else {
// URI doesn't match
true

View file

@ -177,7 +177,7 @@ impl Session {
}
pub fn send_packet(&self, cmd: u8, data: Vec<u8>) {
self.0.tx_connection.send((cmd, data)).unwrap();
self.0.tx_connection.unbounded_send((cmd, data)).unwrap();
}
pub fn cache(&self) -> Option<&Arc<Cache>> {

View file

@ -136,7 +136,7 @@ impl Discovery {
let credentials = Credentials::with_blob(username.to_owned(), &decrypted, &self.0.device_id);
self.0.tx.send(credentials).unwrap();
self.0.tx.unbounded_send(credentials).unwrap();
let result = json!({
"status": 101,

View file

@ -177,28 +177,28 @@ impl Spirc {
}
pub fn play(&self) {
let _ = mpsc::UnboundedSender::send(&self.commands, SpircCommand::Play);
let _ = self.commands.unbounded_send(SpircCommand::Play);
}
pub fn play_pause(&self) {
let _ = mpsc::UnboundedSender::send(&self.commands, SpircCommand::PlayPause);
let _ = self.commands.unbounded_send(SpircCommand::PlayPause);
}
pub fn pause(&self) {
let _ = mpsc::UnboundedSender::send(&self.commands, SpircCommand::Pause);
let _ = self.commands.unbounded_send(SpircCommand::Pause);
}
pub fn prev(&self) {
let _ = mpsc::UnboundedSender::send(&self.commands, SpircCommand::Prev);
let _ = self.commands.unbounded_send(SpircCommand::Prev);
}
pub fn next(&self) {
let _ = mpsc::UnboundedSender::send(&self.commands, SpircCommand::Next);
let _ = self.commands.unbounded_send(SpircCommand::Next);
}
pub fn volume_up(&self) {
let _ = mpsc::UnboundedSender::send(&self.commands, SpircCommand::VolumeUp);
let _ = self.commands.unbounded_send(SpircCommand::VolumeUp);
}
pub fn volume_down(&self) {
let _ = mpsc::UnboundedSender::send(&self.commands, SpircCommand::VolumeDown);
let _ = self.commands.unbounded_send(SpircCommand::VolumeDown);
}
pub fn shutdown(&self) {
let _ = mpsc::UnboundedSender::send(&self.commands, SpircCommand::Shutdown);
let _ = self.commands.unbounded_send(SpircCommand::Shutdown);
}
}