Remove pointless cloning of URI in ::get_uri()

This commit is contained in:
Sebastian Dröge 2016-05-22 16:29:25 +03:00
parent ca4fa82ffe
commit 5673201400
2 changed files with 4 additions and 4 deletions

View file

@ -53,8 +53,8 @@ pub extern "C" fn sink_get_uri(ptr: *const Box<Sink>) -> *mut c_char {
let source: &Box<Sink> = unsafe { &*ptr }; let source: &Box<Sink> = unsafe { &*ptr };
match source.get_uri() { match source.get_uri() {
Some(ref uri) => Some(uri) =>
CString::new(uri.clone().into_bytes()).unwrap().into_raw(), CString::new(uri.into_bytes()).unwrap().into_raw(),
None => None =>
ptr::null_mut() ptr::null_mut()
} }

View file

@ -55,8 +55,8 @@ pub extern "C" fn source_get_uri(ptr: *mut Box<Source>) -> *mut c_char {
let source: &mut Box<Source> = unsafe { &mut *ptr }; let source: &mut Box<Source> = unsafe { &mut *ptr };
match source.get_uri() { match source.get_uri() {
Some(ref uri) => Some(uri) =>
CString::new(uri.clone().into_bytes()).unwrap().into_raw(), CString::new(uri.into_bytes()).unwrap().into_raw(),
None => None =>
ptr::null_mut() ptr::null_mut()
} }