Skip to content

Commit 4818a02

Browse files
author
Hugh Cunningham
committed
fixes lint from vec instantiations in test
1 parent 66e91ad commit 4818a02

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

src/dkg/round3.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,9 @@ mod tests {
558558
)
559559
.expect("round 2 failed");
560560

561-
let mut participants = Vec::with_capacity(2);
562561
let id2_ser: &[u8] = &identity2.serialize();
563562
let id3_ser: &[u8] = &identity3.serialize();
564-
participants.push(id2_ser);
565-
participants.push(id3_ser);
563+
let participants = vec![id2_ser, id3_ser];
566564

567565
let pkg2_ser = package2
568566
.frost_package()
@@ -573,9 +571,7 @@ mod tests {
573571
.serialize()
574572
.expect("serialization failed");
575573

576-
let mut round1_frost_packages: Vec<&[u8]> = Vec::with_capacity(2);
577-
round1_frost_packages.push(&pkg2_ser[..]);
578-
round1_frost_packages.push(&pkg3_ser[..]);
574+
let round1_frost_packages: Vec<&[u8]> = vec![&pkg2_ser[..], &pkg3_ser[..]];
579575

580576
let pkg2_2 = round2_public_packages_2
581577
.package_for(&identity1)
@@ -590,14 +586,13 @@ mod tests {
590586
.serialize()
591587
.expect("round2 public package serialization failed");
592588

593-
let mut round2_frost_packages: Vec<&[u8]> = Vec::with_capacity(2);
594-
round2_frost_packages.push(&pkg2_2[..]);
595-
round2_frost_packages.push(&pkg2_3[..]);
589+
let round2_frost_packages: Vec<&[u8]> = vec![&pkg2_2[..], &pkg2_3[..]];
596590

597-
let mut gsk_bytes: Vec<&[u8]> = Vec::with_capacity(3);
598-
gsk_bytes.push(package1.group_secret_key_shard_encrypted());
599-
gsk_bytes.push(package2.group_secret_key_shard_encrypted());
600-
gsk_bytes.push(package3.group_secret_key_shard_encrypted());
591+
let gsk_bytes: Vec<&[u8]> = vec![
592+
package1.group_secret_key_shard_encrypted(),
593+
package2.group_secret_key_shard_encrypted(),
594+
package3.group_secret_key_shard_encrypted(),
595+
];
601596

602597
round3_min(
603598
&secret1,

0 commit comments

Comments
 (0)