Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): update rand requirement from 0.8 to 0.9 #78

Merged
merged 2 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ rustls-webpki = { version = "0.102", optional = true, default-features = false,
# nonce
base64 = { version = "0.22", optional = true }
memchr = { version = "2", optional = true }
rand = { version = "0.8", optional = true, features = ["small_rng"] }
rand = { version = "0.9", optional = true, features = ["small_rng"] }

# Compression
brotli = { version = "7", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion extensions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ rustls = { version = "0.23.8", optional = true, default-features = false, featur
ron = { version = "0.8", optional = true }
rcgen = { version = "0.13", optional = true }
rustls-pemfile = { version = "2", optional = true }
rand = { version = "0.8", optional = true }
rand = { version = "0.9", optional = true }
dashmap = { version = "6", optional = true }

[features]
Expand Down
2 changes: 1 addition & 1 deletion extensions/src/certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ pub async fn mount<'a, F: Future + Send + 'a>(
let left = (exp - chrono::OffsetDateTime::now_utc()).max(chrono::time::Duration::ZERO);
tokio::time::sleep(left.try_into().expect("we made sure it's positive")).await;
let duration =
Duration::from_secs_f32(rand::Rng::gen_range(&mut rand::thread_rng(), 0.0..10.0));
Duration::from_secs_f32(rand::Rng::random_range(&mut rand::rng(), 0.0..10.0));
// so if multiple are dispatched simultaneously, the first one gets the chance to get
// and write the account
tokio::time::sleep(duration).await;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ impl Extensions {
self.add_present_internal(
"nonce",
present!(ext, {
let data: [u8; 16] = rand::thread_rng().gen();
let data: [u8; 16] = rand::rng().random();
let mut s = BytesMut::with_capacity(24);
unsafe { s.set_len(24) };

Expand Down
2 changes: 1 addition & 1 deletion testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categories = ["web-programming", "development-tools::testing"]
[dependencies]
kvarn = { path = "../", features = ["full"], version = "0.6.2" }
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls-manual-roots", "http2"] }
rand = "0.8"
rand = "0.9"
rcgen = "0.13"
tokio = { version = "1.24", features = ["macros"] }
rustls = "0.23.8"
Expand Down
4 changes: 2 additions & 2 deletions testing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ impl ServerBuilder {
}
async fn get_port() -> u16 {
use rand::prelude::*;
let mut rng = rand::thread_rng();
let port_range = rand::distributions::Uniform::new(4096, 61440);
let mut rng = rand::rng();
let port_range = rand::distr::Uniform::new(4096, 61440).unwrap();

loop {
let port = port_range.sample(&mut rng);
Expand Down