1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 03:57:44 +00:00

sort: adapt to API changes of rand

This commit is contained in:
Daniel Hofstetter 2025-01-29 14:51:20 +01:00
parent 730b404b6e
commit a5fb8f952b
2 changed files with 3 additions and 3 deletions

View file

@ -26,7 +26,7 @@ use fnv::FnvHasher;
#[cfg(target_os = "linux")]
use nix::libc::{getrlimit, rlimit, RLIMIT_NOFILE};
use numeric_str_cmp::{human_numeric_str_cmp, numeric_str_cmp, NumInfo, NumInfoParseSettings};
use rand::{thread_rng, Rng};
use rand::{rng, Rng};
use rayon::prelude::*;
use std::cmp::Ordering;
use std::env;
@ -1742,7 +1742,7 @@ fn general_numeric_compare(a: &GeneralF64ParseResult, b: &GeneralF64ParseResult)
}
fn get_rand_string() -> [u8; 16] {
thread_rng().sample(rand::distributions::Standard)
rng().sample(rand::distr::StandardUniform)
}
fn get_hash<T: Hash>(t: &T) -> u64 {

View file

@ -1275,7 +1275,7 @@ fn test_tmp_files_deleted_on_sigint() {
// approximately 20 MB
for _ in 0..40 {
let lines = SmallRng::seed_from_u64(123)
.sample_iter(rand::distributions::uniform::Uniform::new(0, 10000))
.sample_iter(rand::distr::uniform::Uniform::new(0, 10000).unwrap())
.take(100_000)
.map(|x| x.to_string() + "\n")
.collect::<String>();