From 32467da19081329f45dee96e688390cd7c663aea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Jan 2025 12:24:18 +0000 Subject: [PATCH 1/2] chore(deps): update rand requirement from 0.8 to 0.9 Updates the requirements on [rand](https://github.com/rust-random/rand) to permit the latest version. - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-random/rand/compare/0.8.0...0.8.5) --- updated-dependencies: - dependency-name: rand dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 } From 1cbac8da6974c651f797a5bf903949ae655b415a Mon Sep 17 00:00:00 2001 From: Niklas Adolfsson Date: Wed, 29 Jan 2025 10:18:38 +0100 Subject: [PATCH 2/2] fix breaking changes --- core/src/id_providers.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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() } }