Skip to content

Commit

Permalink
chore(deps): update rand requirement from 0.8 to 0.9 (#1523)
Browse files Browse the repository at this point in the history
* 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](rust-random/rand@0.8.0...0.8.5)

---
updated-dependencies:
- dependency-name: rand
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix breaking changes

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Niklas Adolfsson <[email protected]>
  • Loading branch information
dependabot[bot] and niklasad1 authored Jan 29, 2025
1 parent 656f8bb commit 5767019
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
5 changes: 2 additions & 3 deletions core/src/id_providers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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::<String>().into()
}
}
Expand Down

0 comments on commit 5767019

Please sign in to comment.