Update to librespot 0.2.0 and Tokio v1

This also brings some much need async/.await rewrites
This commit is contained in:
Henrik Friedrichsen
2021-05-07 22:42:08 +02:00
parent 71d42d489e
commit f6a895e160
6 changed files with 736 additions and 861 deletions

View File

@@ -103,10 +103,8 @@ impl Queue {
}
pub fn get_current(&self) -> Option<Playable> {
match self.get_current_index() {
Some(index) => Some(self.queue.read().unwrap()[index].clone()),
None => None,
}
self.get_current_index()
.map(|index| self.queue.read().unwrap()[index].clone())
}
pub fn get_current_index(&self) -> Option<usize> {