mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Fix borrow for Rust 1.32.0
This commit is contained in:
parent
508c7e2b26
commit
ee3a756a6e
1 changed files with 5 additions and 5 deletions
|
@ -836,8 +836,8 @@ impl SpircTask {
|
||||||
// tracks in each frame either have a gid or uri (that may or may not be a valid track)
|
// tracks in each frame either have a gid or uri (that may or may not be a valid track)
|
||||||
// E.g - context based frames sometimes contain tracks with <spotify:meta:page:>
|
// E.g - context based frames sometimes contain tracks with <spotify:meta:page:>
|
||||||
let track = {
|
let track = {
|
||||||
let mut track_ref = &self.state.get_track()[index as usize];
|
let mut track_ref = self.state.get_track()[index as usize].clone();
|
||||||
let mut track_id = self.get_spotify_id_for_track(track_ref);
|
let mut track_id = self.get_spotify_id_for_track(&track_ref);
|
||||||
while track_id.is_err() || track_id.unwrap().audio_type == SpotifyAudioType::NonPlayable {
|
while track_id.is_err() || track_id.unwrap().audio_type == SpotifyAudioType::NonPlayable {
|
||||||
warn!(
|
warn!(
|
||||||
"Skipping track <{:?}> at position [{}] of {}",
|
"Skipping track <{:?}> at position [{}] of {}",
|
||||||
|
@ -846,13 +846,13 @@ impl SpircTask {
|
||||||
tracks_len
|
tracks_len
|
||||||
);
|
);
|
||||||
index = if index + 1 < tracks_len { index + 1 } else { 0 };
|
index = if index + 1 < tracks_len { index + 1 } else { 0 };
|
||||||
|
self.state.set_playing_track_index(index);
|
||||||
if index == start_index {
|
if index == start_index {
|
||||||
warn!("No playable track found in state: {:?}", self.state);
|
warn!("No playable track found in state: {:?}", self.state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
self.state.set_playing_track_index(index);
|
track_ref = self.state.get_track()[index as usize].clone();
|
||||||
track_ref = &self.state.get_track()[index as usize];
|
track_id = self.get_spotify_id_for_track(&track_ref);
|
||||||
track_id = self.get_spotify_id_for_track(track_ref);
|
|
||||||
}
|
}
|
||||||
track_id
|
track_id
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue