From 5312131069685e1f3aa0699fbc4add2a5345cd11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 16 Oct 2023 15:19:52 +0300 Subject: [PATCH] gstreamer: Simplify `MetaAPIExt` trait implementation Part-of: --- gstreamer/src/meta.rs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/gstreamer/src/meta.rs b/gstreamer/src/meta.rs index e1809a39f..648f8ef79 100644 --- a/gstreamer/src/meta.rs +++ b/gstreamer/src/meta.rs @@ -17,20 +17,8 @@ pub unsafe trait MetaAPI: Sync + Send + Sized { } pub trait MetaAPIExt: MetaAPI { + #[inline] #[doc(alias = "gst_meta_api_type_has_tag")] - fn has_tag(&self, tag: glib::Quark) -> bool; - - #[doc(alias = "gst_meta_api_type_get_tags")] - fn tags(&self) -> &[glib::GStringPtr]; - - unsafe fn from_ptr(buffer: &BufferRef, ptr: *const Self::GstType) -> MetaRef; - unsafe fn from_mut_ptr( - buffer: &mut BufferRef, - ptr: *mut Self::GstType, - ) -> MetaRefMut; -} - -impl MetaAPIExt for A { fn has_tag(&self, tag: glib::Quark) -> bool { unsafe { from_glib(ffi::gst_meta_api_type_has_tag( @@ -40,6 +28,8 @@ impl MetaAPIExt for A { } } + #[inline] + #[doc(alias = "gst_meta_api_type_get_tags")] fn tags(&self) -> &[glib::GStringPtr] { unsafe { glib::StrV::from_glib_borrow(ffi::gst_meta_api_type_get_tags( @@ -89,6 +79,8 @@ impl MetaAPIExt for A { } } +impl MetaAPIExt for A {} + #[cfg(feature = "v1_16")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))] #[derive(Debug, Clone, Copy, PartialOrd, Ord, PartialEq, Eq)]