Commit d182584c authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Object::set_name() should not accept NULL

parent 55c8cf69
......@@ -445,6 +445,12 @@ trait_name = "GstObjectExt"
[object.function.return]
nullable = false
[[object.function]]
name = "set_name"
[[object.function.parameter]]
name = "name"
nullable = false
[[object.function]]
name = "get_path_string"
[object.function.return]
......
......@@ -86,7 +86,7 @@ pub trait GstObjectExt {
fn set_control_rate(&self, control_rate: ClockTime);
fn set_name<'a, P: Into<Option<&'a str>>>(&self, name: P) -> Result<(), glib::error::BoolError>;
fn set_name(&self, name: &str) -> Result<(), glib::error::BoolError>;
fn set_parent<P: IsA<Object>>(&self, parent: &P) -> Result<(), glib::error::BoolError>;
......@@ -202,11 +202,9 @@ impl<O: IsA<Object> + IsA<glib::object::Object>> GstObjectExt for O {
}
}
fn set_name<'a, P: Into<Option<&'a str>>>(&self, name: P) -> Result<(), glib::error::BoolError> {
let name = name.into();
let name = name.to_glib_none();
fn set_name(&self, name: &str) -> Result<(), glib::error::BoolError> {
unsafe {
glib::error::BoolError::from_glib(ffi::gst_object_set_name(self.to_glib_none().0, name.0), "Failed to set object name")
glib::error::BoolError::from_glib(ffi::gst_object_set_name(self.to_glib_none().0, name.to_glib_none().0), "Failed to set object name")
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment