From 253f5f4c973eb475930c1b3df655b5d5474b8dfa Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Wed, 19 Mar 2025 16:19:29 -0400 Subject: [PATCH] Upgrade to version 0.9.0 of 'rand' crate. --- Cargo.toml | 2 +- src/pkce.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 434d315..a41a431 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ debug = true [dependencies] fastly = "0.11.2" hmac-sha256 = "1.1.7" -rand = "0.8.5" +rand = "0.9.0" serde = { version = "1.0.203", features = ["derive"] } serde_json = "1.0.120" base64 = "0.22.1" diff --git a/src/pkce.rs b/src/pkce.rs index 791cad2..c336811 100644 --- a/src/pkce.rs +++ b/src/pkce.rs @@ -4,14 +4,14 @@ use base64::{ Engine as _, }; use hmac_sha256::Hash; -use rand::distributions::Alphanumeric; -use rand::{thread_rng, Rng}; +use rand::distr::Alphanumeric; +use rand::{rng, Rng}; use std::iter; const CUSTOM_ENGINE: engine::GeneralPurpose = engine::GeneralPurpose::new(&alphabet::URL_SAFE, general_purpose::NO_PAD); pub fn rand_chars(length: usize) -> String { - let mut rng = thread_rng(); + let mut rng = rng(); iter::repeat(()) .map(|()| rng.sample(Alphanumeric)) .map(char::from)