gstreamer/miniobject: Remove DerefMut and AsMut impls

They were side-stepping the miniobject writability mechanism.
This commit is contained in:
Sebastian Dröge 2020-06-30 15:23:50 +03:00
parent 911bb34dc2
commit dbc76f1053

View file

@ -115,24 +115,12 @@ macro_rules! gst_define_mini_object_wrapper(
}
}
impl ::std::ops::DerefMut for $name {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self.obj.as_ptr() as *mut Self::Target) }
}
}
impl AsRef<$ref_name> for $name {
fn as_ref(&self) -> &$ref_name {
&*self
}
}
impl AsMut<$ref_name> for $name {
fn as_mut(&mut self) -> &mut $ref_name {
&mut *self
}
}
impl ::std::borrow::Borrow<$ref_name> for $name {
fn borrow(&self) -> &$ref_name {
&*self