`impl<'a> IntoIterator for &'a SerializedSignature`

This allows using `&SerializedSignature` in `for` loops and methods like
`Iterator::zip`.
This commit is contained in:
Martin Habovstiak 2022-06-21 19:26:43 +02:00
parent 1d2a1c3fee
commit 901d5ffeb9
1 changed files with 9 additions and 0 deletions

View File

@ -96,6 +96,15 @@ impl ops::Deref for SerializedSignature {
impl Eq for SerializedSignature {}
impl<'a> IntoIterator for &'a SerializedSignature {
type IntoIter = core::slice::Iter<'a, u8>;
type Item = &'a u8;
fn into_iter(self) -> Self::IntoIter {
self.iter()
}
}
impl SerializedSignature {
/// Get a pointer to the underlying data with the specified capacity.
pub(crate) fn get_data_mut_ptr(&mut self) -> *mut u8 {