From fc8b9d2005cba3bfd006b41a99ba0f2cb4a43d6f Mon Sep 17 00:00:00 2001 From: Jan Ferdinand Sauer Date: Sun, 4 Feb 2024 20:04:06 +0100 Subject: [PATCH] refactor(test): use iterator transform instead of explicit loop --- triton-vm/src/proof_item.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/triton-vm/src/proof_item.rs b/triton-vm/src/proof_item.rs index f2650805f..5046fb7ca 100644 --- a/triton-vm/src/proof_item.rs +++ b/triton-vm/src/proof_item.rs @@ -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()); }