diff --git a/gstreamer/src/miniobject.rs b/gstreamer/src/miniobject.rs index 558ad5d7b..cbdc6c10e 100644 --- a/gstreamer/src/miniobject.rs +++ b/gstreamer/src/miniobject.rs @@ -574,17 +574,17 @@ impl MiniObjectRef { unsafe { from_glib((*self.as_ptr()).type_) } } - pub fn downcast_ref(&self) -> Option<&T> { + pub fn downcast_ref(&self) -> Option<&T::RefType> { if self.type_().is_a(T::static_type()) { - unsafe { Some(&*(self as *const Self as *const T)) } + unsafe { Some(&*(self as *const Self as *const T::RefType)) } } else { None } } - pub fn downcast_mut(&mut self) -> Option<&mut T> { + pub fn downcast_mut(&mut self) -> Option<&mut T::RefType> { if self.type_().is_a(T::static_type()) { - unsafe { Some(&mut *(self as *mut Self as *mut T)) } + unsafe { Some(&mut *(self as *mut Self as *mut T::RefType)) } } else { None }