diff --git a/gstreamer/src/caps.rs b/gstreamer/src/caps.rs index 04f94bc20..f0c3aa1d9 100644 --- a/gstreamer/src/caps.rs +++ b/gstreamer/src/caps.rs @@ -372,13 +372,9 @@ macro_rules! define_iter( } unsafe { - let item = $get_item(self.caps, self.idx); - if item.is_none() { - return None; - } - + let item = $get_item(self.caps, self.idx)?; self.idx += 1; - item + Some(item) } }