mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-09-02 01:43:49 +00:00
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.
This commit is contained in:
parent
4798b4bcc9
commit
61b1822c95
1 changed files with 5 additions and 2 deletions
|
@ -22,7 +22,7 @@ use URIType;
|
||||||
|
|
||||||
pub trait URIHandlerImpl: super::element::ElementImpl + Send + Sync + 'static {
|
pub trait URIHandlerImpl: super::element::ElementImpl + Send + Sync + 'static {
|
||||||
fn get_uri(&self, element: &URIHandler) -> Option<String>;
|
fn get_uri(&self, element: &URIHandler) -> Option<String>;
|
||||||
fn set_uri(&self, element: &URIHandler, uri: Option<String>) -> Result<(), glib::Error>;
|
fn set_uri(&self, element: &URIHandler, uri: &str) -> Result<(), glib::Error>;
|
||||||
fn get_uri_type() -> URIType;
|
fn get_uri_type() -> URIType;
|
||||||
fn get_protocols() -> Vec<String>;
|
fn get_protocols() -> Vec<String>;
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,10 @@ where
|
||||||
let instance = &*(uri_handler as *mut T::Instance);
|
let instance = &*(uri_handler as *mut T::Instance);
|
||||||
let imp = instance.get_impl();
|
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(),
|
Ok(()) => true.to_glib(),
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
*err = error.to_glib_full() as *mut _;
|
*err = error.to_glib_full() as *mut _;
|
||||||
|
|
Loading…
Reference in a new issue