From 28a22557e4a1392f159d4fd4e8d68e40ab0e6037 Mon Sep 17 00:00:00 2001 From: Philippe Laferriere Date: Tue, 7 Nov 2023 07:28:47 -0500 Subject: [PATCH] Consuming iterator for RpoDigest --- src/hash/rescue/rpo/digest.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/hash/rescue/rpo/digest.rs b/src/hash/rescue/rpo/digest.rs index 9bed0974..a4cfa174 100644 --- a/src/hash/rescue/rpo/digest.rs +++ b/src/hash/rescue/rpo/digest.rs @@ -302,6 +302,17 @@ impl Deserializable for RpoDigest { } } +// ITERATORS +// ================================================================================================ +impl IntoIterator for RpoDigest { + type Item = Felt; + type IntoIter = <[Felt; 4] as IntoIterator>::IntoIter; + + fn into_iter(self) -> Self::IntoIter { + self.0.into_iter() + } +} + // TESTS // ================================================================================================