Skip to main content

Update the use of two deprecated methods

ID
5224bba
date
2025-01-28 12:59:16+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
ba765d1
message
Update the use of two deprecated methods
changed files
1 file, 1 addition, 1 deletion

Changed files

src/sampling.rs (7158) → src/sampling.rs (7154)

diff --git a/src/sampling.rs b/src/sampling.rs
index 2feef2c..94c3d76 100644
--- a/src/sampling.rs
+++ b/src/sampling.rs
@@ -111,7 +111,7 @@ pub fn reservoir_sample<T>(mut items: impl Iterator<Item = T>, k: usize) -> Vec<
 
 /// Create a random weight u_i ~ U[0,1]
 fn pick_weight() -> f64 {
-    rand::thread_rng().gen_range(0.0..1.0)
+    rand::rng().random_range(0.0..1.0)
 }
 
 #[cfg(test)]