Cleaned up unnecessary clone() calls.

This commit is contained in:
Jordan Petridis
2017-10-21 09:08:03 +03:00
parent 64cd388aeb
commit 90c637ed53
7 changed files with 24 additions and 27 deletions
+2 -2
View File
@@ -84,7 +84,7 @@ fn epidose_widget(
// TODO: emit a signal and show notification when dl is finished and block play_bttn till
// then.
thread::spawn(move || {
let dl_fold = downloader::get_dl_folder(&pd_title.clone()).unwrap();
let dl_fold = downloader::get_dl_folder(&pd_title).unwrap();
let tempdb = db_clone.lock().unwrap();
let e = downloader::get_episode(&tempdb, &mut ep_clone, dl_fold.as_str());
drop(tempdb);
@@ -109,7 +109,7 @@ pub fn episodes_listbox(connection: &Arc<Mutex<SqliteConnection>>, pd_title: &st
let list = gtk::ListBox::new();
episodes.iter_mut().for_each(|ep| {
let w = epidose_widget(&connection.clone(), ep, pd_title);
let w = epidose_widget(&connection, ep, pd_title);
list.add(&w)
});
+1 -1
View File
@@ -110,7 +110,7 @@ pub fn podcast_liststore(connection: &SqliteConnection) -> gtk::ListStore {
pub fn pd_widget_from_diesel_model(db: &Arc<Mutex<SqliteConnection>>, pd: &Podcast) -> gtk::Box {
let img = get_pixbuf_from_path(pd.image_uri(), pd.title());
podcast_widget(&db.clone(), Some(pd.title()), Some(pd.description()), img)
podcast_widget(&db, Some(pd.title()), Some(pd.description()), img)
}
pub fn get_pixbuf_from_path(img_path: Option<&str>, pd_title: &str) -> Option<Pixbuf> {