Skip to content

Commit

Permalink
impl<'a> IntoIterator for &'a SerializedSignature
Browse files Browse the repository at this point in the history
This allows using `&SerializedSignature` in `for` loops and methods like
`Iterator::zip`.
  • Loading branch information
Kixunil committed Jun 21, 2022
1 parent 1d2a1c3 commit 901d5ff
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/ecdsa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 901d5ff

Please sign in to comment.