mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
sort: adapt to API changes of rand
This commit is contained in:
parent
730b404b6e
commit
a5fb8f952b
2 changed files with 3 additions and 3 deletions
|
@ -26,7 +26,7 @@ use fnv::FnvHasher;
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
use nix::libc::{getrlimit, rlimit, RLIMIT_NOFILE};
|
use nix::libc::{getrlimit, rlimit, RLIMIT_NOFILE};
|
||||||
use numeric_str_cmp::{human_numeric_str_cmp, numeric_str_cmp, NumInfo, NumInfoParseSettings};
|
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 rayon::prelude::*;
|
||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
use std::env;
|
use std::env;
|
||||||
|
@ -1742,7 +1742,7 @@ fn general_numeric_compare(a: &GeneralF64ParseResult, b: &GeneralF64ParseResult)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_rand_string() -> [u8; 16] {
|
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 {
|
fn get_hash<T: Hash>(t: &T) -> u64 {
|
||||||
|
|
|
@ -1275,7 +1275,7 @@ fn test_tmp_files_deleted_on_sigint() {
|
||||||
// approximately 20 MB
|
// approximately 20 MB
|
||||||
for _ in 0..40 {
|
for _ in 0..40 {
|
||||||
let lines = SmallRng::seed_from_u64(123)
|
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)
|
.take(100_000)
|
||||||
.map(|x| x.to_string() + "\n")
|
.map(|x| x.to_string() + "\n")
|
||||||
.collect::<String>();
|
.collect::<String>();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue