From 067f3935927b6051cb797f61007d56a3fe1844f2 Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Tue, 6 Aug 2024 01:02:45 +0300 Subject: [PATCH] chore(docs): fix clippy warnings in examples (#712) --- frost-ed25519/README.md | 4 ++-- frost-ed448/README.md | 4 ++-- frost-p256/README.md | 4 ++-- frost-ristretto255/README.md | 4 ++-- frost-secp256k1/README.md | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frost-ed25519/README.md b/frost-ed25519/README.md index 6560d5b0..f9f267c7 100644 --- a/frost-ed25519/README.md +++ b/frost-ed25519/README.md @@ -45,14 +45,14 @@ let mut commitments_map = BTreeMap::new(); //////////////////////////////////////////////////////////////////////////// // In practice, each iteration of this loop will be executed by its respective participant. -for participant_index in 1..(min_signers as u16 + 1) { +for participant_index in 1..=min_signers { let participant_identifier = participant_index.try_into().expect("should be nonzero"); let key_package = &key_packages[&participant_identifier]; // Generate one (1) nonce and one SigningCommitments instance for each // participant, up to _threshold_. # // ANCHOR: round1_commit let (nonces, commitments) = frost::round1::commit( - key_packages[&participant_identifier].signing_share(), + key_package.signing_share(), &mut rng, ); # // ANCHOR_END: round1_commit diff --git a/frost-ed448/README.md b/frost-ed448/README.md index 74d8fa6d..7cf30ff1 100644 --- a/frost-ed448/README.md +++ b/frost-ed448/README.md @@ -45,14 +45,14 @@ let mut commitments_map = BTreeMap::new(); //////////////////////////////////////////////////////////////////////////// // In practice, each iteration of this loop will be executed by its respective participant. -for participant_index in 1..(min_signers as u16 + 1) { +for participant_index in 1..=min_signers { let participant_identifier = participant_index.try_into().expect("should be nonzero"); let key_package = &key_packages[&participant_identifier]; // Generate one (1) nonce and one SigningCommitments instance for each // participant, up to _threshold_. # // ANCHOR: round1_commit let (nonces, commitments) = frost::round1::commit( - key_packages[&participant_identifier].signing_share(), + key_package.signing_share(), &mut rng, ); # // ANCHOR_END: round1_commit diff --git a/frost-p256/README.md b/frost-p256/README.md index 7f0a20fe..df0cc4a0 100644 --- a/frost-p256/README.md +++ b/frost-p256/README.md @@ -45,14 +45,14 @@ let mut commitments_map = BTreeMap::new(); //////////////////////////////////////////////////////////////////////////// // In practice, each iteration of this loop will be executed by its respective participant. -for participant_index in 1..(min_signers as u16 + 1) { +for participant_index in 1..=min_signers { let participant_identifier = participant_index.try_into().expect("should be nonzero"); let key_package = &key_packages[&participant_identifier]; // Generate one (1) nonce and one SigningCommitments instance for each // participant, up to _threshold_. # // ANCHOR: round1_commit let (nonces, commitments) = frost::round1::commit( - key_packages[&participant_identifier].signing_share(), + key_package.signing_share(), &mut rng, ); # // ANCHOR_END: round1_commit diff --git a/frost-ristretto255/README.md b/frost-ristretto255/README.md index 436b953d..a2d28425 100644 --- a/frost-ristretto255/README.md +++ b/frost-ristretto255/README.md @@ -45,14 +45,14 @@ let mut commitments_map = BTreeMap::new(); //////////////////////////////////////////////////////////////////////////// // In practice, each iteration of this loop will be executed by its respective participant. -for participant_index in 1..(min_signers as u16 + 1) { +for participant_index in 1..=min_signers { let participant_identifier = participant_index.try_into().expect("should be nonzero"); let key_package = &key_packages[&participant_identifier]; // Generate one (1) nonce and one SigningCommitments instance for each // participant, up to _threshold_. # // ANCHOR: round1_commit let (nonces, commitments) = frost::round1::commit( - key_packages[&participant_identifier].signing_share(), + key_package.signing_share(), &mut rng, ); # // ANCHOR_END: round1_commit diff --git a/frost-secp256k1/README.md b/frost-secp256k1/README.md index 0d420737..9e4928b3 100644 --- a/frost-secp256k1/README.md +++ b/frost-secp256k1/README.md @@ -45,14 +45,14 @@ let mut commitments_map = BTreeMap::new(); //////////////////////////////////////////////////////////////////////////// // In practice, each iteration of this loop will be executed by its respective participant. -for participant_index in 1..(min_signers as u16 + 1) { +for participant_index in 1..=min_signers { let participant_identifier = participant_index.try_into().expect("should be nonzero"); let key_package = &key_packages[&participant_identifier]; // Generate one (1) nonce and one SigningCommitments instance for each // participant, up to _threshold_. # // ANCHOR: round1_commit let (nonces, commitments) = frost::round1::commit( - key_packages[&participant_identifier].signing_share(), + key_package.signing_share(), &mut rng, ); # // ANCHOR_END: round1_commit