build: update rand to 0.9

We already have both rand 0.8 and rand 0.9
in our dependency tree.

We still need rand 0.8 because
public APIs of rPGP 0.17.0 and Iroh 0.35.0
use rand 0.8 types in public APIs,
so it is imported as rand_old.
This commit is contained in:
link2xt
2025-10-26 00:54:26 +00:00
committed by l
parent 0e30dd895f
commit f428033d95
15 changed files with 22 additions and 31 deletions

View File

@@ -32,7 +32,7 @@ use mailparse::MailHeaderMap;
use mailparse::dateparse;
use mailparse::headers::Headers;
use num_traits::PrimInt;
use rand::{Rng, thread_rng};
use rand::Rng;
use tokio::{fs, io};
use url::Url;
use uuid::Uuid;
@@ -291,7 +291,7 @@ async fn maybe_warn_on_outdated(context: &Context, now: i64, approx_compile_time
/// and divides both by 8 (byte size) and 6 (number of bits in a single Base64 character).
pub(crate) fn create_id() -> String {
// ThreadRng implements CryptoRng trait and is supposed to be cryptographically secure.
let mut rng = thread_rng();
let mut rng = rand::rng();
// Generate 144 random bits.
let mut arr = [0u8; 18];