From 81b1ec810cdec2b5311ee10c53e6c7a53193635a Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Sun, 7 Jan 2018 08:36:02 +0200 Subject: [PATCH] Apply clippy suggestions. --- hammond-data/src/utils.rs | 2 +- hammond-gtk/src/utils.rs | 8 +++----- hammond-gtk/src/widgets/episode.rs | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/hammond-data/src/utils.rs b/hammond-data/src/utils.rs index c9a55a6..1e7f4c2 100644 --- a/hammond-data/src/utils.rs +++ b/hammond-data/src/utils.rs @@ -139,7 +139,7 @@ pub fn get_download_folder(pd_title: &str) -> Result { /// TODO: Write Tests /// TODO: Return Result instead pub fn delete_show(pd: &Podcast) { - let res = dbqueries::remove_feed(&pd); + let res = dbqueries::remove_feed(pd); if res.is_ok() { info!("{} was removed succesfully.", pd.title()); diff --git a/hammond-gtk/src/utils.rs b/hammond-gtk/src/utils.rs index 34370a2..849eba6 100644 --- a/hammond-gtk/src/utils.rs +++ b/hammond-gtk/src/utils.rs @@ -22,11 +22,9 @@ pub fn refresh_feed(headerbar: Arc
, source: Option>, sender: thread::spawn(move || { if let Some(s) = source { feed::index_loop(s); - } else { - if let Err(err) = feed::index_all() { - error!("Error While trying to update the database."); - error!("Error msg: {}", err); - } + } else if let Err(err) = feed::index_all() { + error!("Error While trying to update the database."); + error!("Error msg: {}", err); }; sender.send(Action::HeaderBarHideUpdateIndicator).unwrap(); diff --git a/hammond-gtk/src/widgets/episode.rs b/hammond-gtk/src/widgets/episode.rs index bcb4061..c8f061a 100644 --- a/hammond-gtk/src/widgets/episode.rs +++ b/hammond-gtk/src/widgets/episode.rs @@ -154,10 +154,10 @@ impl EpisodeWidget { fn set_date(&self, epoch: i32) { let date = Utc.timestamp(i64::from(epoch), 0); if NOW.year() == date.year() { - self.date.set_text(&date.format("%e %b").to_string().trim()); + self.date.set_text(date.format("%e %b").to_string().trim()); } else { self.date - .set_text(&date.format("%e %b %Y").to_string().trim()); + .set_text(date.format("%e %b %Y").to_string().trim()); }; }