Skip to content

Commit

Permalink
Use iter and take instead of loop index
Browse files Browse the repository at this point in the history
Clear clippy warning:

  the loop variable `i` is only used to index `sks`
  • Loading branch information
tcharding committed May 13, 2024
1 parent c8ea819 commit 3ad8c0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bitcoind-tests/tests/setup/test_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ fn setup_keys(
let mut x_only_keypairs = vec![];
let mut x_only_pks = vec![];

for i in 0..n {
let keypair = bitcoin::secp256k1::Keypair::from_secret_key(&secp_sign, &sks[i]);
for sk in sks.iter().take(n) {
let keypair = bitcoin::secp256k1::Keypair::from_secret_key(&secp_sign, sk);
let (xpk, _parity) = XOnlyPublicKey::from_keypair(&keypair);
x_only_keypairs.push(keypair);
x_only_pks.push(xpk);
Expand Down

0 comments on commit 3ad8c0e

Please sign in to comment.