diff --git a/Cargo.toml b/Cargo.toml index a6d7618064..be01f3960b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,7 +61,7 @@ pin-project = "1.1.3" proc-macro-crate = "3" proc-macro2 = "1" quote = "1" -rand = "0.8" +rand = "0.9" route-recognizer = "0.3.1" rustc-hash = "2" rustls = { version = "0.23", default-features = false } diff --git a/core/src/id_providers.rs b/core/src/id_providers.rs index 3a45a71bdc..a0cae5e89b 100644 --- a/core/src/id_providers.rs +++ b/core/src/id_providers.rs @@ -26,8 +26,7 @@ //! Subscription ID providers. -use rand::distributions::Alphanumeric; -use rand::Rng; +use rand::{distr::Alphanumeric, Rng}; use crate::traits::IdProvider; use jsonrpsee_types::SubscriptionId; @@ -58,7 +57,7 @@ impl RandomStringIdProvider { impl IdProvider for RandomStringIdProvider { fn next_id(&self) -> SubscriptionId<'static> { - let mut rng = rand::thread_rng(); + let mut rng = rand::rng(); (&mut rng).sample_iter(Alphanumeric).take(self.len).map(char::from).collect::().into() } }