From fc978c5730bc2d6a2e9db473816b9f1c78ebfb34 Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Fri, 6 Dec 2024 09:41:24 +0100 Subject: [PATCH] implement IntoIterator for InitialNalUnits --- src/nal_unit.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nal_unit.rs b/src/nal_unit.rs index 102c3d0..434e3e6 100644 --- a/src/nal_unit.rs +++ b/src/nal_unit.rs @@ -279,9 +279,10 @@ pub struct InitialNalUnits { pub frame: NalUnit, } -impl InitialNalUnits { - /// Return an [Iterator] over the NAL units generated at the start of encoding. - pub fn into_iter(self) -> impl Iterator { +impl std::iter::IntoIterator for InitialNalUnits { + type Item = NalUnit; + type IntoIter = alloc::vec::IntoIter; + fn into_iter(self) -> Self::IntoIter { vec![self.sps, self.pps, self.frame].into_iter() } }