diff --git a/gstreamer-rtp/src/rtp_buffer.rs b/gstreamer-rtp/src/rtp_buffer.rs index 563ffd63e..0cbabf77a 100644 --- a/gstreamer-rtp/src/rtp_buffer.rs +++ b/gstreamer-rtp/src/rtp_buffer.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use glib::translate::{from_glib, from_glib_full, FromGlibPtrFull, IntoGlib}; +use glib::translate::{from_glib, FromGlibPtrFull, IntoGlib}; use std::fmt; use std::marker::PhantomData; use std::mem; @@ -266,13 +266,11 @@ impl<'a, T> RTPBuffer<'a, T> { pub fn extension_bytes(&self) -> Option<(u16, glib::Bytes)> { unsafe { let mut bits: u16 = 0; - match from_glib_full(ffi::gst_rtp_buffer_get_extension_bytes( + Option::::from_glib_full(ffi::gst_rtp_buffer_get_extension_bytes( glib::translate::mut_override(&self.rtp_buffer), &mut bits, - )) { - Some(bytes) => Some((bits, bytes)), - None => None, - } + )) + .map(|bytes| (bits, bytes)) } } diff --git a/gstreamer/src/structure.rs b/gstreamer/src/structure.rs index 47b4c4cdf..3c422d4ba 100644 --- a/gstreamer/src/structure.rs +++ b/gstreamer/src/structure.rs @@ -756,11 +756,7 @@ impl<'a> DoubleEndedIterator for FieldIterator<'a> { } self.n_fields -= 1; - if let Some(field_name) = self.structure.nth_field_name(self.n_fields) { - Some(field_name) - } else { - None - } + self.structure.nth_field_name(self.n_fields) } }