Add `impl IntoIterator for &'_ Witness`
It is considered idiomatic for types that have `iter()` method to also implement `IntoIterator` for their references. `Witness` was missing this so it is added here.
This commit is contained in:
parent
21ae79bed4
commit
d2ed0fe022
|
@ -274,6 +274,15 @@ impl<'a> Iterator for Iter<'a> {
|
||||||
|
|
||||||
impl<'a> ExactSizeIterator for Iter<'a> {}
|
impl<'a> ExactSizeIterator for Iter<'a> {}
|
||||||
|
|
||||||
|
impl<'a> IntoIterator for &'a Witness {
|
||||||
|
type IntoIter = Iter<'a>;
|
||||||
|
type Item = &'a [u8];
|
||||||
|
|
||||||
|
fn into_iter(self) -> Self::IntoIter {
|
||||||
|
self.iter()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Serde keep backward compatibility with old Vec<Vec<u8>> format
|
// Serde keep backward compatibility with old Vec<Vec<u8>> format
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
impl serde::Serialize for Witness {
|
impl serde::Serialize for Witness {
|
||||||
|
|
Loading…
Reference in New Issue