From d19c70694a0e4d6e57340d3534294c0898b17cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 11 Oct 2018 11:30:12 +0300 Subject: [PATCH] Use ? operator instead of explictly propagating None --- gstreamer/src/caps.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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) } }