Skip to content

Commit 266f41d

Browse files
committed
Fix clippy alerts
1 parent 6b6e85b commit 266f41d

File tree

6 files changed

+15
-9
lines changed

6 files changed

+15
-9
lines changed

.github/workflows/rust.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ jobs:
5858
with:
5959
cache-on-failure: "true"
6060
- name: Run clippy
61-
run: cargo clippy --all --lib --exclude cggmp21-tests -- --no-deps -D clippy::all -D clippy::unwrap_used -D clippy::expect_used
61+
run: cargo clippy --all --all-features --lib --exclude cggmp21-tests -- --no-deps -D clippy::all -D clippy::unwrap_used -D clippy::expect_used
6262
- name: Run clippy tests
63-
run: cargo clippy --tests --lib -- -D clippy::all
63+
run: cargo clippy --tests --all-features --lib -- -D clippy::all
6464
bench:
6565
runs-on: ubuntu-latest
6666
permissions:

cggmp21-keygen/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Threshold and non-threshold CGGMP21 DKG
2-
#![allow(non_snake_case)]
2+
#![allow(non_snake_case, clippy::too_many_arguments)]
33

44
pub mod progress;
55
pub mod security_level;

key-share/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ impl<E: Curve> Validate for DirtyCoreKeyShare<E> {
151151
}
152152
}
153153

154+
#[allow(clippy::nonminimal_bool)]
154155
fn validate_vss_key_share<E: Curve>(
155156
key_share: &DirtyCoreKeyShare<E>,
156157
n: u16,

key-share/src/utils.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
#[cfg(feature = "serde")]
1+
#[cfg(all(feature = "serde", feature = "hd-wallets"))]
22
mod hex_or_bin;
33

4-
#[cfg(feature = "serde")]
4+
#[cfg(all(feature = "serde", feature = "hd-wallets"))]
55
pub use hex_or_bin::HexOrBin;
6+
7+
// `hex` dependnecy is only needed when both `serde` and `hd-wallets` features are on.
8+
// However, we can't express that in Cargo.toml, so whenever `serde` feature is on and
9+
// `hd-wallets` is off, unused dependency is introduced.
10+
#[cfg(all(feature = "serde", not(feature = "hd-wallets")))]
11+
use hex as _;

key-share/src/valid.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ where
216216
where
217217
S: serde::Serializer,
218218
{
219-
(&**self).serialize(serializer)
219+
(**self).serialize(serializer)
220220
}
221221
}
222222

tests/src/lib.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ pub fn convert_from_stark_scalar(
169169
pub fn random_derivation_path(rng: &mut impl rand::RngCore) -> Vec<u32> {
170170
use rand::Rng;
171171
let len = rng.gen_range(1..=3);
172-
let path = std::iter::repeat_with(|| rng.gen_range(0..cggmp21::slip_10::H))
172+
std::iter::repeat_with(|| rng.gen_range(0..cggmp21::slip_10::H))
173173
.take(len)
174-
.collect::<Vec<_>>();
175-
path
174+
.collect::<Vec<_>>()
176175
}

0 commit comments

Comments
 (0)