Skip to content

Commit 901d5ff

Browse files
committed
impl<'a> IntoIterator for &'a SerializedSignature
This allows using `&SerializedSignature` in `for` loops and methods like `Iterator::zip`.
1 parent 1d2a1c3 commit 901d5ff

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/ecdsa/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ impl ops::Deref for SerializedSignature {
9696

9797
impl Eq for SerializedSignature {}
9898

99+
impl<'a> IntoIterator for &'a SerializedSignature {
100+
type IntoIter = core::slice::Iter<'a, u8>;
101+
type Item = &'a u8;
102+
103+
fn into_iter(self) -> Self::IntoIter {
104+
self.iter()
105+
}
106+
}
107+
99108
impl SerializedSignature {
100109
/// Get a pointer to the underlying data with the specified capacity.
101110
pub(crate) fn get_data_mut_ptr(&mut self) -> *mut u8 {

0 commit comments

Comments
 (0)