From 56732014004ba4b0fadd3cc0698005cc201d0daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 22 May 2016 16:29:25 +0300 Subject: [PATCH] Remove pointless cloning of URI in ::get_uri() --- src/rssink.rs | 4 ++-- src/rssource.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rssink.rs b/src/rssink.rs index 95874b15..963367e2 100644 --- a/src/rssink.rs +++ b/src/rssink.rs @@ -53,8 +53,8 @@ pub extern "C" fn sink_get_uri(ptr: *const Box) -> *mut c_char { let source: &Box = unsafe { &*ptr }; match source.get_uri() { - Some(ref uri) => - CString::new(uri.clone().into_bytes()).unwrap().into_raw(), + Some(uri) => + CString::new(uri.into_bytes()).unwrap().into_raw(), None => ptr::null_mut() } diff --git a/src/rssource.rs b/src/rssource.rs index 064dab6c..32cc1c6a 100644 --- a/src/rssource.rs +++ b/src/rssource.rs @@ -55,8 +55,8 @@ pub extern "C" fn source_get_uri(ptr: *mut Box) -> *mut c_char { let source: &mut Box = unsafe { &mut *ptr }; match source.get_uri() { - Some(ref uri) => - CString::new(uri.clone().into_bytes()).unwrap().into_raw(), + Some(uri) => + CString::new(uri.into_bytes()).unwrap().into_raw(), None => ptr::null_mut() }