diff --git a/src/rsfilesink.rs b/src/rsfilesink.rs index 0d82f228..8da9596a 100644 --- a/src/rsfilesink.rs +++ b/src/rsfilesink.rs @@ -50,8 +50,8 @@ impl FileSink { } impl Sink for FileSink { - fn set_uri(&mut self, uri_str: &Option<&str>) -> bool { - match *uri_str { + fn set_uri(&mut self, uri_str: Option<&str>) -> bool { + match uri_str { None => { self.location = None; return true; diff --git a/src/rsfilesrc.rs b/src/rsfilesrc.rs index 1350be79..4a115ee0 100644 --- a/src/rsfilesrc.rs +++ b/src/rsfilesrc.rs @@ -51,8 +51,8 @@ impl FileSrc { } impl Source for FileSrc { - fn set_uri(&mut self, uri_str: &Option<&str>) -> bool { - match *uri_str { + fn set_uri(&mut self, uri_str: Option<&str>) -> bool { + match uri_str { None => { self.location = None; return true; diff --git a/src/rshttpsrc.rs b/src/rshttpsrc.rs index 12b859db..3ee387ef 100644 --- a/src/rshttpsrc.rs +++ b/src/rshttpsrc.rs @@ -123,13 +123,13 @@ impl HttpSrc { } impl Source for HttpSrc { - fn set_uri(&mut self, uri_str: &Option<&str>) -> bool { + fn set_uri(&mut self, uri_str: Option<&str>) -> bool { if self.response.is_some() { println_err!("Can't set URI after starting"); return false; } - match *uri_str { + match uri_str { None => { self.url = None; return true; diff --git a/src/rssink.rs b/src/rssink.rs index a5516ad3..95874b15 100644 --- a/src/rssink.rs +++ b/src/rssink.rs @@ -24,7 +24,7 @@ use std::ptr; use utils::*; pub trait Sink: Sync + Send { - fn set_uri(&mut self, uri_str: &Option<&str>) -> bool; + fn set_uri(&mut self, uri_str: Option<&str>) -> bool; fn get_uri(&self) -> Option; fn start(&mut self) -> bool; fn stop(&mut self) -> bool; @@ -41,10 +41,10 @@ pub extern "C" fn sink_set_uri(ptr: *mut Box, uri_ptr: *const c_char) -> G let source: &mut Box = unsafe { &mut *ptr }; if uri_ptr.is_null() { - GBoolean::from_bool(source.set_uri(&None)) + GBoolean::from_bool(source.set_uri(None)) } else { let uri = unsafe { CStr::from_ptr(uri_ptr) }; - GBoolean::from_bool(source.set_uri(&Some(uri.to_str().unwrap()))) + GBoolean::from_bool(source.set_uri(Some(uri.to_str().unwrap()))) } } diff --git a/src/rssource.rs b/src/rssource.rs index 6ecc02c1..8c8230b4 100644 --- a/src/rssource.rs +++ b/src/rssource.rs @@ -23,7 +23,7 @@ use std::ptr; use utils::*; pub trait Source: Sync + Send { - fn set_uri(&mut self, uri_str: &Option<&str>) -> bool; + fn set_uri(&mut self, uri_str: Option<&str>) -> bool; fn get_uri(&self) -> Option; fn is_seekable(&self) -> bool; fn get_size(&self) -> u64; @@ -45,10 +45,10 @@ pub extern "C" fn source_set_uri(ptr: *mut Box, uri_ptr: *const c_char) let source: &mut Box = unsafe { &mut *ptr }; if uri_ptr.is_null() { - GBoolean::from_bool(source.set_uri(&None)) + GBoolean::from_bool(source.set_uri(None)) } else { let uri = unsafe { CStr::from_ptr(uri_ptr) }; - GBoolean::from_bool(source.set_uri(&Some(uri.to_str().unwrap()))) + GBoolean::from_bool(source.set_uri(Some(uri.to_str().unwrap()))) } }