Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 3 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ hex = "0.4"
base64 = "0.22"

# Misc
rand = "0.8"
rand = "0.9"
dirs = "5"
clap = { version = "4", features = ["derive"] }
anyhow = "1"
Expand Down
10 changes: 5 additions & 5 deletions src/queue/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ impl QueueManager {
.filter(|&i| i != self.current_index)
.collect();
if !remaining.is_empty() {
let mut rng = rand::thread_rng();
self.current_index = remaining[rng.gen_range(0..remaining.len())];
let mut rng = rand::rng();
self.current_index = remaining[rng.random_range(0..remaining.len())];
} else if self.repeat == RepeatMode::All {
let mut rng = rand::thread_rng();
self.current_index = rng.gen_range(0..self.queue.len() as i32);
let mut rng = rand::rng();
self.current_index = rng.random_range(0..self.queue.len() as i32);
} else {
return None;
}
Expand Down Expand Up @@ -309,7 +309,7 @@ impl QueueManager {
.filter(|(i, _)| *i != self.current_index as usize)
.map(|(_, s)| s.clone())
.collect();
let mut rng = rand::thread_rng();
let mut rng = rand::rng();
others.shuffle(&mut rng);
if let Some(cur) = current {
self.queue = std::iter::once(cur).chain(others).collect();
Expand Down
4 changes: 2 additions & 2 deletions src/subsonic/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ pub const CLIENT_NAME: &str = "CLIMusicPlayer";

/// Generate authentication parameters using the token+salt method.
pub fn auth_params(username: &str, password: &str) -> HashMap<String, String> {
let salt: String = rand::thread_rng()
.sample_iter(&rand::distributions::Alphanumeric)
let salt: String = rand::rng()
.sample_iter(&rand::distr::Alphanumeric)
.take(32)
.map(char::from)
.collect();
Expand Down
Loading