Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 37 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ qsv-stats = "0.45"
qsv_currency = "0.7"
qsv-tabwriter = "2"
qsv_vader_sentiment_analysis = { version = "0.2", optional = true }
rand = "0.9"
rand_hc = "0.4"
rand_xoshiro = "0.7"
rand = "0.10"
rand_hc = "0.5"
rand_xoshiro = "0.8"
rayon = "1.11"
redis = { version = "1", features = ["ahash"], default-features = false }
regex = "1"
Expand Down Expand Up @@ -433,7 +433,6 @@ feature_capable = []
nightly = [
"crc32fast/nightly",
"pyo3/nightly",
"rand/nightly",
"rand/simd_support",
"simd-json/hints",
"foldhash/nightly",
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ use log::{
Level::{Debug, Trace, Warn},
debug, error, info, log_enabled, warn,
};
use rand::Rng;
use rand::RngExt;
use regex::Regex;
use reqwest::{
blocking::Client,
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/fetchpost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ use log::{
};
use minijinja::Environment;
use minijinja_contrib::pycompat::unknown_method_callback;
use rand::Rng;
use rand::RngExt;
use regex::Regex;
use reqwest::{
blocking::Client,
Expand Down
10 changes: 5 additions & 5 deletions src/cmd/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ use foldhash::{HashMap, HashMapExt, HashSet, HashSetExt};
use futures_util::StreamExt;
use qsv_dateparser::parse_with_preference_and_timezone;
use rand::{
Rng, SeedableRng,
Rng, RngExt, SeedableRng,
distr::{Bernoulli, Distribution},
prelude::IndexedRandom,
rngs::StdRng,
Expand Down Expand Up @@ -381,7 +381,7 @@ trait RngProvider: Sized {
if let Some(seed) = seed {
Self::RngType::seed_from_u64(seed) // DevSkim: ignore DS148264
} else {
Self::RngType::from_os_rng()
rand::make_rng::<Self::RngType>()
}
}
}
Expand Down Expand Up @@ -1922,21 +1922,21 @@ fn sample_cluster<R: io::Read, W: io::Write>(
RngKind::Standard => {
let mut rng = StandardRng::create(seed);
all_clusters
.choose_multiple(&mut rng, requested_clusters.min(all_clusters.len()))
.sample(&mut rng, requested_clusters.min(all_clusters.len()))
.cloned()
.collect()
},
RngKind::Faster => {
let mut rng = FasterRng::create(seed);
all_clusters
.choose_multiple(&mut rng, requested_clusters.min(all_clusters.len()))
.sample(&mut rng, requested_clusters.min(all_clusters.len()))
.cloned()
.collect()
},
RngKind::Cryptosecure => {
let mut rng = CryptoRng::create(seed);
all_clusters
.choose_multiple(&mut rng, requested_clusters.min(all_clusters.len()))
.sample(&mut rng, requested_clusters.min(all_clusters.len()))
.cloned()
.collect()
},
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
// cryptographic security in this context.
rand::rngs::StdRng::seed_from_u64(seed) // DevSkim: ignore DS148264
},
_ => rand::rngs::StdRng::from_os_rng(),
_ => rand::make_rng::<rand::rngs::StdRng>(),
};

let initial_selection = rconfig.selection(&headers)?;
Expand Down
6 changes: 3 additions & 3 deletions src/cmd/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Common options:
use std::{cmp, str::FromStr};

// use fastrand; //DevSkim: ignore DS148264
use rand::{Rng, SeedableRng, rngs::StdRng, seq::SliceRandom};
use rand::{RngExt, SeedableRng, rngs::StdRng, seq::SliceRandom};
use rand_hc::Hc128Rng;
use rand_xoshiro::Xoshiro256Plus;
use rayon::slice::ParallelSliceMut;
Expand Down Expand Up @@ -180,7 +180,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
},
RngKind::Faster => {
let mut rng = match args.flag_seed {
None => Xoshiro256Plus::from_os_rng(),
None => rand::make_rng::<Xoshiro256Plus>(),
Some(sd) => Xoshiro256Plus::seed_from_u64(sd), // DevSkim: ignore DS148264
};
SliceRandom::shuffle(&mut *all, &mut rng); //DevSkim: ignore DS148264
Expand All @@ -196,7 +196,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
},
};
let mut rng: Hc128Rng = match args.flag_seed {
None => Hc128Rng::from_os_rng(),
None => rand::make_rng::<Hc128Rng>(),
Some(_) => Hc128Rng::from_seed(seed_32),
};
SliceRandom::shuffle(&mut *all, &mut rng);
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use std::{env, io, time::Instant};

extern crate qsv_docopt as docopt;
use docopt::Docopt;
use rand::Rng;
use rand::RngExt;
use serde::Deserialize;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion src/mainlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{env, io, time::Instant};

extern crate qsv_docopt as docopt;
use docopt::Docopt;
use rand::Rng;
use rand::RngExt;
use serde::Deserialize;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion src/odhtcache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ impl Drop for ExtDedupCache {
mod tests {
use std::fs;

use rand::{Rng, distr::Alphanumeric, rng};
use rand::{RngExt, distr::Alphanumeric, rng};
use tempfile::TempDir;

use super::*;
Expand Down
2 changes: 1 addition & 1 deletion tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extern crate stats;
use std::{env, fmt, mem::transmute, ops};

use quickcheck::{Arbitrary, Gen, QuickCheck, Testable};
use rand::Rng;
use rand::RngExt;
// use assert_eq;

macro_rules! svec[
Expand Down