Skip to content

Commit 8856e6c

Browse files
committed
Remove unused features in rand
1 parent ffd399c commit 8856e6c

File tree

3 files changed

+3
-71
lines changed

3 files changed

+3
-71
lines changed

Cargo.lock

Lines changed: 0 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ serde_arrays = { version = "0.1.0", optional = true }
1515

1616
[dev-dependencies]
1717
criterion = { version = "0.5", features = ["html_reports"] }
18-
rand = "0.8"
18+
rand = { version = "0.8", default-features = false, features = ["small_rng"] }
1919

2020
[features]
2121
# Derives the `Serialize` and `Deserialize` traits from [`serde`](https://crates.io/crates/serde) for the `Primes` struct, as well as a few others.

benches/prime_benches.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use const_primes::{is_prime, primes, primes_geq, primes_lt, sieve, sieve_geq, sieve_lt};
22
use criterion::{criterion_group, criterion_main, BatchSize, Criterion, Throughput};
3-
use rand::prelude::*;
3+
use rand::{rngs::SmallRng, Rng, SeedableRng};
44
use std::hint::black_box;
55

66
fn benchmarks(c: &mut Criterion) {
@@ -20,7 +20,7 @@ fn benchmarks(c: &mut Criterion) {
2020

2121
{
2222
const N: u64 = 10_000;
23-
let mut rng = StdRng::seed_from_u64(1234567890);
23+
let mut rng = SmallRng::seed_from_u64(1234567890);
2424
let mut primality_testing = c.benchmark_group("primality testing");
2525
primality_testing.throughput(Throughput::Elements(N));
2626
primality_testing.bench_function(format!("is_prime on {N} random numbers"), |b| {

0 commit comments

Comments
 (0)