Skip to content

Commit

Permalink
refactor(test): use iterator transform instead of explicit loop
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ferdinand committed Feb 4, 2024
1 parent c8a8f8c commit fc8b9d2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions triton-vm/src/proof_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,9 @@ pub(crate) mod tests {

#[test]
fn can_loop_over_proof_item_variants() {
let mut all_discriminants = HashSet::new();
for variant in ProofItemVariant::iter() {
all_discriminants.insert(variant.bfield_codec_discriminant());
}

let all_discriminants: HashSet<_> = ProofItemVariant::iter()
.map(|variant| variant.bfield_codec_discriminant())
.collect();
assert_eq!(ProofItem::COUNT, all_discriminants.len());
}

Expand Down

0 comments on commit fc8b9d2

Please sign in to comment.