Skip to content

Commit c7ba346

Browse files
authored
Update to rand 0.9 (#1505)
1 parent 3c1303b commit c7ba346

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ opentelemetry = { version = "0.31.0", optional = true }
111111
pem = { version = "3.0.4", optional = true }
112112
percent-encoding = "2.0.0"
113113
pkcs8 = { version = "0.10.2", features = ["encryption", "pkcs5"], optional = true }
114-
rand = { version = "0.8.3", features = ["small_rng"] }
114+
rand = { version = "0.9", features = ["small_rng"] }
115115
rayon = { version = "1.5.3", optional = true }
116116
rustc_version_runtime = "0.3.0"
117117
serde_with = { version = "3.8.1", default-features = false, features = ["macros"] }

src/client/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ pub(crate) enum FirstRound {
633633
}
634634

635635
pub(crate) fn generate_nonce_bytes() -> [u8; 32] {
636-
rand::thread_rng().gen()
636+
rand::rng().random()
637637
}
638638

639639
pub(crate) fn generate_nonce() -> String {

src/sdam/description/topology.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,8 +741,8 @@ impl TopologyDescription {
741741
}
742742

743743
pub(crate) fn choose_n<T>(values: &[T], n: usize) -> impl Iterator<Item = &T> {
744-
use rand::{prelude::SliceRandom, SeedableRng};
745-
values.choose_multiple(&mut rand::rngs::SmallRng::from_entropy(), n)
744+
use rand::{seq::IndexedRandom, SeedableRng};
745+
values.choose_multiple(&mut rand::rngs::SmallRng::from_os_rng(), n)
746746
}
747747

748748
/// Enum representing whether transactions are supported by the topology.

0 commit comments

Comments
 (0)