mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Update Spirc depreciated rand method
This commit is contained in:
parent
0a9a293315
commit
0686fe545f
1 changed files with 3 additions and 2 deletions
|
@ -18,7 +18,7 @@ use playback::mixer::Mixer;
|
|||
use playback::player::Player;
|
||||
|
||||
use rand;
|
||||
use rand::Rng;
|
||||
use rand::seq::SliceRandom;
|
||||
use std;
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
|
@ -508,7 +508,8 @@ impl SpircTask {
|
|||
let tracks = self.state.mut_track();
|
||||
tracks.swap(0, current_index as usize);
|
||||
if let Some((_, rest)) = tracks.split_first_mut() {
|
||||
rand::thread_rng().shuffle(rest);
|
||||
let mut rng = rand::thread_rng();
|
||||
rest.shuffle(&mut rng);
|
||||
}
|
||||
}
|
||||
self.state.set_playing_track_index(0);
|
||||
|
|
Loading…
Reference in a new issue