diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs index 87bf4645..0d825d6a 100644 --- a/connect/src/spirc.rs +++ b/connect/src/spirc.rs @@ -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);