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

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

View file

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