From 547cfb44e2230ffc160700349322a200e601ac72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 11 Oct 2023 16:06:20 +0300 Subject: [PATCH] gstreamer: Simplify `Element::element_class()` implementation a bit Part-of: --- gstreamer/src/element.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gstreamer/src/element.rs b/gstreamer/src/element.rs index 999c0075b..5de09618d 100644 --- a/gstreamer/src/element.rs +++ b/gstreamer/src/element.rs @@ -110,11 +110,7 @@ pub trait ElementExtManual: sealed::Sealed + IsA + 'static { #[doc(alias = "get_element_class")] #[inline] fn element_class(&self) -> &glib::Class { - unsafe { - let klass = (*(self.as_ptr() as *mut glib::gobject_ffi::GTypeInstance)).g_class - as *const glib::Class; - &*klass - } + unsafe { self.unsafe_cast_ref::().class() } } #[doc(alias = "get_current_state")]