Skip to content

Commit 21a6520

Browse files
committed
Clippy fixes in the benches; add benches to the clippy task in CI
1 parent 132dcc3 commit 21a6520

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.github/workflows/crypto-primes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
components: clippy
112112
override: true
113113
profile: minimal
114-
- run: cargo clippy --all --all-features --tests -- -D warnings
114+
- run: cargo clippy --all --all-features --tests --benches -- -D warnings
115115

116116
rustfmt:
117117
runs-on: ubuntu-latest

benches/bench.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ use crypto_primes::{
1313
safe_prime_with_rng,
1414
};
1515

16-
fn bench_sieve<'a, M: Measurement>(group: &mut BenchmarkGroup<'a, M>) {
16+
fn bench_sieve<M: Measurement>(group: &mut BenchmarkGroup<'_, M>) {
1717
let start: U1024 = random_odd_uint(&mut OsRng, 1024);
1818
group.bench_function("(U1024) Sieve, 1000 samples", |b| {
1919
b.iter(|| Sieve::new(&start, 1024, false).take(1000).for_each(drop))
2020
});
2121
}
2222

23-
fn bench_miller_rabin<'a, M: Measurement>(group: &mut BenchmarkGroup<'a, M>) {
23+
fn bench_miller_rabin<M: Measurement>(group: &mut BenchmarkGroup<'_, M>) {
2424
let start: U1024 = random_odd_uint(&mut OsRng, 1024);
2525
group.bench_function("(U1024) Miller-Rabin creation", |b| {
2626
b.iter(|| {
@@ -41,7 +41,7 @@ fn bench_miller_rabin<'a, M: Measurement>(group: &mut BenchmarkGroup<'a, M>) {
4141
);
4242
}
4343

44-
fn bench_lucas<'a, M: Measurement>(group: &mut BenchmarkGroup<'a, M>) {
44+
fn bench_lucas<M: Measurement>(group: &mut BenchmarkGroup<'_, M>) {
4545
let mut rng = ChaCha8Rng::from_seed(*b"01234567890123456789012345678901");
4646

4747
let start: U1024 = random_odd_uint(&mut rng, 1024);
@@ -117,7 +117,7 @@ fn bench_primality_tests(c: &mut Criterion) {
117117
group.finish();
118118
}
119119

120-
fn bench_presets<'a, M: Measurement>(group: &mut BenchmarkGroup<'a, M>) {
120+
fn bench_presets<M: Measurement>(group: &mut BenchmarkGroup<'_, M>) {
121121
group.bench_function("(U128) Random safe prime", |b| {
122122
b.iter(|| {
123123
let p: U128 = safe_prime_with_rng(&mut OsRng, 128);

0 commit comments

Comments
 (0)