From 61b1822c952fc834440f276449796d2023d87424 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Sat, 25 May 2019 19:10:36 +0200 Subject: [PATCH] gstreamer: Fix URIHander::set_uri annotation We don't actually accept a NULL uri, so it doesn't need to be an Option, and using &str instead of String is more efficient. --- gstreamer/src/subclass/uri_handler.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gstreamer/src/subclass/uri_handler.rs b/gstreamer/src/subclass/uri_handler.rs index 415bf0c3e..bb1337e5a 100644 --- a/gstreamer/src/subclass/uri_handler.rs +++ b/gstreamer/src/subclass/uri_handler.rs @@ -22,7 +22,7 @@ use URIType; pub trait URIHandlerImpl: super::element::ElementImpl + Send + Sync + 'static { fn get_uri(&self, element: &URIHandler) -> Option; - fn set_uri(&self, element: &URIHandler, uri: Option) -> Result<(), glib::Error>; + fn set_uri(&self, element: &URIHandler, uri: &str) -> Result<(), glib::Error>; fn get_uri_type() -> URIType; fn get_protocols() -> Vec; } @@ -97,7 +97,10 @@ where let instance = &*(uri_handler as *mut T::Instance); let imp = instance.get_impl(); - match imp.set_uri(&from_glib_borrow(uri_handler), from_glib_none(uri)) { + match imp.set_uri( + &from_glib_borrow(uri_handler), + glib::GString::from_glib_borrow(uri).as_str(), + ) { Ok(()) => true.to_glib(), Err(error) => { *err = error.to_glib_full() as *mut _;