gstreamer: Simplify Element::element_class() implementation a bit

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1322>
This commit is contained in:
Sebastian Dröge 2023-10-11 16:06:20 +03:00
parent 3f16233a01
commit 547cfb44e2

View file

@ -110,11 +110,7 @@ pub trait ElementExtManual: sealed::Sealed + IsA<Element> + 'static {
#[doc(alias = "get_element_class")] #[doc(alias = "get_element_class")]
#[inline] #[inline]
fn element_class(&self) -> &glib::Class<Element> { fn element_class(&self) -> &glib::Class<Element> {
unsafe { unsafe { self.unsafe_cast_ref::<Element>().class() }
let klass = (*(self.as_ptr() as *mut glib::gobject_ffi::GTypeInstance)).g_class
as *const glib::Class<Element>;
&*klass
}
} }
#[doc(alias = "get_current_state")] #[doc(alias = "get_current_state")]