From d182584c252df6c79310a60e1c0c79e7ec3ff873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 20 Dec 2017 18:31:08 +0200 Subject: [PATCH] Object::set_name() should not accept NULL --- Gir_Gst.toml | 6 ++++++ gstreamer/src/auto/object.rs | 8 +++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Gir_Gst.toml b/Gir_Gst.toml index 187bbd7a9..256f26860 100644 --- a/Gir_Gst.toml +++ b/Gir_Gst.toml @@ -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] diff --git a/gstreamer/src/auto/object.rs b/gstreamer/src/auto/object.rs index bf21cf7e8..90b116409 100644 --- a/gstreamer/src/auto/object.rs +++ b/gstreamer/src/auto/object.rs @@ -86,7 +86,7 @@ pub trait GstObjectExt { fn set_control_rate(&self, control_rate: ClockTime); - fn set_name<'a, P: Into>>(&self, name: P) -> Result<(), glib::error::BoolError>; + fn set_name(&self, name: &str) -> Result<(), glib::error::BoolError>; fn set_parent>(&self, parent: &P) -> Result<(), glib::error::BoolError>; @@ -202,11 +202,9 @@ impl + IsA> GstObjectExt for O { } } - fn set_name<'a, P: Into>>(&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") } }