chore: update dependency rand to 0.9

This commit is contained in:
Gwen Lg
2026-01-28 23:47:38 +01:00
committed by Alex
parent be8e4c9dcf
commit 934c4c31f1
9 changed files with 53 additions and 24 deletions
+1 -1
View File
@@ -780,7 +780,7 @@ impl BlockManagerLocked {
assert!(to_delete.as_ref() != Some(&tgt_path));
let mut path_tmp = tgt_path.clone();
let tmp_extension = format!("tmp{}", hex::encode(thread_rng().gen::<[u8; 4]>()));
let tmp_extension = format!("tmp{}", hex::encode(rand::rng().random::<[u8; 4]>()));
path_tmp.set_extension(tmp_extension);
fs::create_dir_all(&directory).await?;
+1 -1
View File
@@ -248,7 +248,7 @@ fn randomize_next_scrub_run_time(timestamp: u64) -> u64 {
timestamp
+ SCRUB_INTERVAL
.saturating_add(Duration::from_secs(
rand::thread_rng().gen_range(0..3600 * 24 * 10),
rand::rng().random_range(0..3600 * 24 * 10),
))
.as_millis() as u64
}
+1 -1
View File
@@ -130,7 +130,7 @@ impl Worker for AutoSnapshotWorker {
async_snapshot_metadata(&self.garage).await?;
let rand_factor = 1f32 + thread_rng().gen::<f32>() / 5f32;
let rand_factor = 1f32 + rand::rng().random::<f32>() / 5f32;
self.next_snapshot = Instant::now() + self.snapshot_interval.mul_f32(rand_factor);
Ok(WorkerState::Idle)
+1 -1
View File
@@ -78,7 +78,7 @@ impl OrderTag {
/// let tag_2 = stream.order(2);
/// ```
pub fn stream() -> OrderTagStream {
OrderTagStream(thread_rng().gen())
OrderTagStream(rand::rng().random())
}
}
impl OrderTagStream {
+1 -1
View File
@@ -510,7 +510,7 @@ impl<F: TableSchema, R: TableReplication> SyncWorker<F, R> {
partitions.layout_version
);
partitions.partitions.shuffle(&mut thread_rng());
partitions.partitions.shuffle(&mut rand::rng());
self.todo = Some(partitions);
}
Err(e) => {
+1 -1
View File
@@ -151,7 +151,7 @@ pub fn fasthash(data: &[u8]) -> FastHash {
/// Generate a random 32 bytes UUID
pub fn gen_uuid() -> Uuid {
rand::thread_rng().gen::<[u8; 32]>().into()
rand::rng().random::<[u8; 32]>().into()
}
#[cfg(test)]
+1 -1
View File
@@ -59,5 +59,5 @@ where
// ----
pub fn gen_trace_id() -> TraceId {
rand::thread_rng().gen::<[u8; 16]>().into()
rand::rng().random::<[u8; 16]>().into()
}