Skip to content

Commit

Permalink
Merge pull request #216 from 0xPolygonMiden/plafer-digest-iter
Browse files Browse the repository at this point in the history
Implement `IntoIterator` for `RpoDigest`
  • Loading branch information
plafer authored Nov 7, 2023
2 parents b677952 + 28a2255 commit 9f0aaf6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/hash/rescue/rpo/digest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
// ================================================================================================

Expand Down

0 comments on commit 9f0aaf6

Please sign in to comment.